Bug #81425 [NEW]: exit being ignored in loops
| From: | Kai dot Habel at duofaktur dot de | Date: | Wed, 08 Sep 2021 12:56:31 +0000 |
| Subject: | Bug #81425 [NEW]: exit being ignored in loops | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-236460@lists.php.net to get a copy of this message | ||
From: Kai dot Habel at duofaktur dot de
Operating system: Centos 8
PHP version: 8.0.10
Package: *General Issues
Bug Type: Bug
Bug description:exit being ignored in loops
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 bug report at https://bugs.php.net/bug.php?id=81425&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81425&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81425&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81425&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81425&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81425&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81425&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81425&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81425&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81425&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81425&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81425&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81425&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81425&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81425&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81425&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81425&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81425&r=mysqlcfg