Skip to content

Commit 5d095f8

Browse files
ekinhbayarnikic
authored andcommitted
Test for bug 74431
1 parent b760508 commit 5d095f8

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

ext/opcache/tests/bug74431.phpt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--TEST--
2+
Bug #74431 - foreach infinite loop
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.optimization_level=0xffffffff
7+
--FILE--
8+
<?php
9+
function test(){
10+
$arr = [1,2];
11+
$j = 0;
12+
$cond = true;
13+
foreach ($arr as $i => $v){
14+
while(1){
15+
if($cond){
16+
break;
17+
}
18+
}
19+
$j++;
20+
echo $j."\n";
21+
if ($j>10) break;
22+
}
23+
}
24+
test();
25+
?>
26+
--EXPECT--
27+
1
28+
2

0 commit comments

Comments
 (0)