Bug #81425 [Opn->Fbk]: exit being ignored in loops
| From: | girgias@php.net | Date: | Wed, 08 Sep 2021 12:58:53 +0000 |
| Subject: | Bug #81425 [Opn->Fbk]: exit being ignored in loops | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236461@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81425&edit=1
ID: 81425
Updated by: girgias@php.net
Reported by: Kai dot Habel at duofaktur dot de
Summary: exit being ignored in loops
-Status: Open
+Status: Feedback
Type: Bug
Package: *General Issues
Operating System: Centos 8
PHP Version: 8.0.10
Block user comment: N
Private report: N
New Comment:
That's not true, see:
https://3v4l.org/WZFU1
Previous Comments:
------------------------------------------------------------------------
[2021-09-08 12:56:31] Kai dot Habel at duofaktur dot de
Description:
------------
Prior to php 8.0 calls to exit or die worked within loops like foreach or switch.
Since 8.0 these statements are totally ignored and this is causing hours and hours of work to use a
goto call to end processing in each and every php file.
Test script:
---------------
$a = 2;
switch($a)
{
case 1:
echo "1";
exit;
break;
case 2:
echo "2";
exit;
break;
case 3:
echo "3";
exit;
break;
}
echo "4";
Expected result:
----------------
1
Actual result:
--------------
14
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81425&edit=1