mirror of
https://github.com/php/php-src.git
synced 2026-04-27 18:23:26 +02:00
2d03b638dc
We only need to preserve the FE_FREE that marks the end of the loop range. Skip FE_FREEs with the FREE_ON_RETURN flag.
19 lines
292 B
PHP
19 lines
292 B
PHP
--TEST--
|
|
Check that SCCP correctly handles non-terminating frees of loop variables
|
|
--FILE--
|
|
<?php
|
|
function test() {
|
|
$arr = [];
|
|
foreach ($arr as $item) {
|
|
if (!empty($result)) {
|
|
return $result;
|
|
}
|
|
}
|
|
return 2;
|
|
}
|
|
|
|
var_dump(test());
|
|
?>
|
|
--EXPECT--
|
|
int(2)
|