`set_error_handler` should be able to handle fatal error once
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
Currently, fatal error can be handled, but it is not possible to do so using handler set by set_error_handler, but workaround using register_shutdown_function. This is not only too complex, but there is no guarantee such handler is/was registered as the first shutdown function.
An example is here: https://github.com/phpstan/phpstan-src/blob/1.10.50/src/Command/CommandHelper.php#L137-L154
This is a feature request to allow error handler to handle fatal error when php enters into shutdown before the 1st shutdown handler is executed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing set_error_handler and register_shutdown_function behavior described in the issue, and review the linked phpstan example for the current workaround. Done means a fatal error can be handled once through the error handler before the first shutdown handler runs, without relying on a separately registered shutdown function.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100