php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79948 Exit in auto-prepended file does not abort PHP execution
Submitted: 2020-08-09 23:21 UTC Modified: 2020-08-10 08:28 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: weirdan at gmail dot com Assigned: nikic (profile)
Status: Closed Package: *General Issues
PHP Version: 8.0.0beta1 OS: Debian/sid, MacOS X
Private report: No CVE-ID: None
 [2020-08-09 23:21 UTC] weirdan at gmail dot com
Description:
------------
When exit() is used in a file pointed to by auto_prepend_file directive it does not abort the execution of PHP in PHP 8. It used to abort execution in PHP 7 (last tested with PHP 7.4.5).

Test script:
---------------
// prepend.php
<?php
var_dump('exiting');
exit(22);
var_dump('after exit');
?>

// main.php
 <?php
var_dump('executing');

// run as php -dauto_prepend_file=prepend.php main.php


Expected result:
----------------
string(7) "exiting"

Actual result:
--------------
string(7) "exiting"
string(9) "executing"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-10 08:28 UTC] nikic@php.net
-Assigned To: +Assigned To: nikic
 [2020-08-10 09:15 UTC] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ee163161480f4196d618036728f4765de7139068
Log: Fixed bug #79948
 [2020-08-10 09:15 UTC] nikic@php.net
-Status: Assigned +Status: Closed
 [2020-08-10 10:09 UTC] weirdan at gmail dot com
That was quick. Thanks, Nikita!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC