1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 18:23:26 +02:00
Files
archived-php-src/ext/opcache/tests/sccp_loop_var_free.phpt
T
Nikita Popov 2d03b638dc Fix handling of non-final loop var free in sccp
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.
2019-12-12 09:39:52 +01:00

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)