|  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
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: weirdan at gmail dot com
New email:
PHP Version: OS:


 [2020-08-09 23:21 UTC] weirdan at gmail dot com
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
var_dump('after exit');

// main.php

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

Expected result:
string(7) "exiting"

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-10 08:28 UTC]
-Assigned To: +Assigned To: nikic
 [2020-08-10 09:15 UTC]
Automatic comment on behalf of
Log: Fixed bug #79948
 [2020-08-10 09:15 UTC]
-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: Mon Apr 15 03:01:28 2024 UTC