xref: /PHP-8.4/Zend/tests/generators/gh9801.phpt (revision f39b5c4c)
1--TEST--
2Bug GH-9801 (Crash when memory limit is exceeded during generator initialization)
3--INI--
4memory_limit=16m
5--SKIPIF--
6<?php
7$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
8if ($zend_mm_enabled === "0") {
9    die("skip Zend MM disabled");
10}
11?>
12--FILE--
13<?php
14
15function a() {
16    yield from a();
17}
18
19foreach(a() as $v);
20?>
21--EXPECTF--
22Fatal error: Allowed memory size of %d bytes exhausted %s
23