Bug #81485 [Opn->Fbk]: exit; does not terminate program
Edit report at https://bugs.php.net/bug.php?id=81485&edit=1
ID: 81485
Updated by: requinix@php.net
Reported by: mhkhung at gmail dot com
Summary: exit; does not terminate program
-Status: Open
+Status: Feedback
Type: Bug
Package: *General Issues
Operating System: Debian 11
PHP Version: 8.0.11
Block user comment: N
Private report: N
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
Works fine here. https://3v4l.org/LFL2m
Maybe you have the same problem as https://bugs.php.net/bug.php?id=81431 ?
Previous Comments:
------------------------------------------------------------------------
[2021-09-28 03:09:38] mhkhung at gmail dot com
Description:
------------
This problem only happens on php 8. I tested latest 8.0.11 and 8.0.10 on Debian 11 and checked my
sanity with php7.4 which will output the expected results.
exit; appears to exit from current function only. The program will keep going.
Expected result: exit will terminate the script.
Test script:
---------------
<?php
function e() {
echo "in e\n";
exit;
}
echo "before e\n";
e();
echo "after e\n";
Expected result:
----------------
before e
in e
Actual result:
--------------
before e
in e
after e
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81485&edit=1
Thread (5 messages)