Bug #81485 [Fbk]: exit; does not terminate program

From: Date: Tue, 28 Sep 2021 10:11:32 +0000
Subject: Bug #81485 [Fbk]: exit; does not terminate program
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236885@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81485&edit=1

 ID:                 81485
 Updated by:         nikic@php.net
 Reported by:        mhkhung at gmail dot com
 Summary:            exit; does not terminate program
 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:

Please check phpinfo or "php -m" for whether you have the uopz extension loaded. It
converts exit into a no-op.


Previous Comments:
------------------------------------------------------------------------
[2021-09-28 05:38:17] requinix@php.net

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 ?

------------------------------------------------------------------------
[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)

« previous php.bugs (#236885) next »