php-src/Zend/tests/generators/nested_calls_with_die.phpt
Nikita Popov 114245c1b9 Fix bug #63830: Segfault on undefined function call in nested generator
This also reverses the destruction order of the pushed arguments to
align with how it is done everywhere else.

I'm not exactly sure whether this is the right way to fix it, but it
seems to work fine.
2013-02-01 19:53:04 +01:00

31 lines
441 B
PHP

--TEST--
Test nested calls with die() in a generator
--FILE--
<?php
function gen() {
die('Test');
yield; // force generator
}
function function_with_3_args() {
$gen = gen();
$gen->rewind();
}
function function_with_4_args() {
function_with_3_args(4, 5, 6);
}
function outerGen() {
function_with_4_args(0, 1, 2, 3);
yield; // force generator
}
$outerGen = outerGen();
$outerGen->rewind();
?>
--EXPECT--
Test