mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
Test for bug 74431
This commit is contained in:
parent
b760508adc
commit
5d095f80c9
1 changed files with 28 additions and 0 deletions
28
ext/opcache/tests/bug74431.phpt
Normal file
28
ext/opcache/tests/bug74431.phpt
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #74431 - foreach infinite loop
|
||||||
|
--INI--
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.enable_cli=1
|
||||||
|
opcache.optimization_level=0xffffffff
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
function test(){
|
||||||
|
$arr = [1,2];
|
||||||
|
$j = 0;
|
||||||
|
$cond = true;
|
||||||
|
foreach ($arr as $i => $v){
|
||||||
|
while(1){
|
||||||
|
if($cond){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$j++;
|
||||||
|
echo $j."\n";
|
||||||
|
if ($j>10) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
test();
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
1
|
||||||
|
2
|
Loading…
Add table
Add a link
Reference in a new issue