Description
The following code:
<?php declare(strict_types=1);
register_shutdown_function(static function () {
exit; // prevent further shutdown handlers from being called
});
exit(1);
https://3v4l.org/C9oKE#v
Results in exit code 0 since PHP8.4, while it returned the original exit code 1 in previous versions.
According to the documentation, this is should be a valid way to stop shutdown_function propagation:
If you call exit() within one registered shutdown function, processing will stop completely and no other registered shutdown functions will be called.
This was spotted in #15796 with a potential fix in #19445, but both don't fix the breaking change. It's also not mentioned in the upgrade guide from PHP8.3 to PHP8.4. Was this intended to be a breaking change? Should this be documented somewhere?
PHP Version
8.4.1 - 8.4.18, 8.5.0 - 8.5.3 (from above sample from 3v4l.org)
Operating System
No response
Description
The following code:
https://3v4l.org/C9oKE#v
Results in exit code
0since PHP8.4, while it returned the original exit code1in previous versions.According to the documentation, this is should be a valid way to stop shutdown_function propagation:
This was spotted in #15796 with a potential fix in #19445, but both don't fix the breaking change. It's also not mentioned in the upgrade guide from PHP8.3 to PHP8.4. Was this intended to be a breaking change? Should this be documented somewhere?
PHP Version
Operating System
No response