mirror of
https://github.com/php/php-src.git
synced 2024-10-03 07:46:12 +00:00
29 lines
448 B
Plaintext
29 lines
448 B
Plaintext
|
--TEST--
|
||
|
Use of finally in generator without interrupt
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
function gen() {
|
||
|
try {
|
||
|
throw new Exception;
|
||
|
} finally {
|
||
|
echo "finally run\n";
|
||
|
}
|
||
|
|
||
|
yield; // force generator
|
||
|
}
|
||
|
|
||
|
$gen = gen();
|
||
|
$gen->rewind(); // force run
|
||
|
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
finally run
|
||
|
|
||
|
Fatal error: Uncaught exception 'Exception' in %s:%d
|
||
|
Stack trace:
|
||
|
#0 [internal function]: gen()
|
||
|
#1 %s(%d): Generator->rewind()
|
||
|
#2 {main}
|
||
|
thrown in %s on line %d
|