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

From: Date: Tue, 28 Sep 2021 03:09:38 +0000
Subject: Bug #81485 [NEW]: exit; does not terminate program
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236877@lists.php.net to get a copy of this message
From:             mhkhung at gmail dot com
Operating system: Debian 11
PHP version:      8.0.11
Package:          *General Issues
Bug Type:         Bug
Bug description:exit; does not terminate program

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 bug report at https://bugs.php.net/bug.php?id=81485&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=81485&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=81485&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=81485&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=81485&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=81485&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=81485&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=81485&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=81485&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=81485&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=81485&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81485&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=81485&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=81485&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=81485&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=81485&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=81485&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=81485&r=mysqlcfg


Thread (5 messages)

« previous php.bugs (#236877) next »