[php-src] Issue #11967: Shutdown callback is affected by max execution time, but documentation says otherwise.
| From: | Serchman | Date: | Mon, 14 Aug 2023 12:59:28 +0000 |
| Subject: | [php-src] Issue #11967: Shutdown callback is affected by max execution time, but documentation says otherwise. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245179@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11967
Author: Serchman
### Description
It is reproducible here:
https://www.tehplayground.com/PwpR764URQYi79Lj
Resulted in this output:
```
Fatal error: Maximum execution time of 1 second exceeded in Standard input code on line 20
Start of shutdown
Fatal error: Maximum execution time of 1 second exceeded in Standard input code on line 37
```
But I expected this output instead:
```
Fatal error: Maximum execution time of 1 second exceeded in Standard input code on line 20
Start of shutdown
End of shutdown
```
As per the documentation we would expect the shutdown callback to not be affected by any limits set.
As documented here:
https://www.php.net/manual/en/function.register-shutdown-function.php#:~:text=to%20end%20cleanly.-,Note%3A,while%20a%20shutdown%20function%20is%20running%20it%20will%20not%20be%20terminated.,-See%20Also%20%C2%B6
This is a problem for my usecase where if there is a Fatal error , in this case due to timeout, we
want to run the shutdown function and not run into a timeout.
### PHP Version
PHP Latest
### Operating System
_No response_