Bug #81425 [Fbk]: exit being ignored in loops
| From: | cmb@php.net | Date: | Wed, 08 Sep 2021 13:07:02 +0000 |
| Subject: | Bug #81425 [Fbk]: exit being ignored in loops | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236462@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: cmb@php.net
Reported by: Kai dot Habel at duofaktur dot de
Summary: exit being ignored in loops
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:
Do you use uopz?
Previous Comments:
------------------------------------------------------------------------
[2021-09-08 12:58:53] girgias@php.net
That's not true, see:
https://3v4l.org/WZFU1
------------------------------------------------------------------------
[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