Bug #74431 [Com]: foreach infinite loop

From: Date: Thu, 13 Apr 2017 20:30:22 +0000
Subject: Bug #74431 [Com]: foreach infinite loop
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208536@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74431&edit=1 ID: 74431 Comment by: ekin at coproductivity dot com Reported by: onceatease at gmail dot com Summary: foreach infinite loop Status: Open Type: Bug Package: opcache Operating System: Ubuntu 12.04.5 LTS PHP Version: 7.1.2 Block user comment: N Private report: N New Comment: I cannot reproduce this with php-fpm on any of 7.1.2, 7.1.3 or 7.1.4 on Ubuntu 16.04 LTS, having opcache enabled. Which related opcache settings did you use? Previous Comments: ------------------------------------------------------------------------ [2017-04-13 10:07:47] onceatease at gmail dot com exec correctly in php7.1.0 test without php7.1.3 ------------------------------------------------------------------------ [2017-04-13 10:02:02] onceatease at gmail dot com Description: ------------ foreach will infinite loop in php-fpm, in the case while condition is literal and if conditon is a variable(in both php7.1.2 and php7.1.4) Test script: --------------- $arr = [1,2]; $j = 0; $cond = true; foreach ($arr as $i => $v){ while(1){ if($cond){ break; } } $j++; echo $j."<br>"; //if($j>100) break; } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74431&edit=1

« previous php.bugs (#208536) next »