xref: /PHP-7.1/ext/opcache/tests/bug74431.phpt (revision 5d095f80)
1--TEST--
2Bug #74431 - foreach infinite loop
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=0xffffffff
7--FILE--
8<?php
9function 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}
24test();
25?>
26--EXPECT--
271
282
29