E_RECOVERABLE_ERROR
Following my posting and the following discussion about "Type Hints throwing a fatal-non-catchable error when a wrong object is passed", I wrote up a patch that adds a new error level to PHP (6): E_RECOVERABLE_ERROR. This error level can be used for cases where the engine decides that something is wrong, but when it doesn't end up in an unstable state. This means that we have yet another level, and they should be used IMO for the following cases:
E_NOTICE: Just for little notices to inform the user that something might have gone wrong.
E_WARNING: Something went wrong, probably resulting in unwanted behavior
-
should be fixed by the script's writer.
E_RECOVERABLE_ERROR: An error situation occurred, which is probably dangerous for a script to continue, but does not leave the Engine itself in an unstable state. If this one is not caught in a user defined error handler, the application aborts.
E_ERROR: The engine is in an unstable state, we have to abort. Not catchable by a user defined error handler.
For now the new error level E_RECOVERABLE_ERROR is only implemented for type-hints, but lots of extensions are still using E_ERROR, when there is no need for it. They need updating to make those errors E_RECOVERABLE_ERROR, or preferrably E_WARNING (or even E_NOTICE).
Update: We renamed E_RECOVERABLE to E_RECOVERABLE_ERROR.
The patch is online for 6.0 (already committed) and 5.1 (not committed).
Life Line
I know my French is pretty terrible, but I'm sure I'm closer to the correct answer than what's shown here...
Merge branch 'v2022'
Merge pull request #169 from psumbera/solaris-2
I walked 7.0km in 1h6m48s
Fixed some ffing sidewalks again.
I walked 10.5km in 1h40m26s
Updated a pet_grooming shop
I walked 8.6km in 2h12m58s
I walked 8.7km in 1h24m16s
Updated a restaurant
I walked 2.4km in 24m20s
I walked 6.6km in 1h4m32s
I walked 0.6km in 4m38s
I walked 8.5km in 1h22m35s
Merged pull request #1029
Reflow some comments
Add comments, add end of file newlines, fix php 8.5 compilation
Benchmark Xdebug performance
Merged pull request #1051
PHP 8.6: printf() is now optimised out if it only uses %s and %d (and…
PHP 8.6: The object IDs of objects changed in tests
PHP 8.6: ZSTR_INIT_LITERAL() no longer takes non-literals, so use zen…
PHP 8.6: WRONG_PARAM_COUNT has been removed in favour of zend_wrong_p…
PHP 8.6: zval_dtor() has been deprecated in favour of zval_ptr_dtor_n…
Update test for version constraints, as well as the error messages


Shortlink
This article has a short URL available: https://drck.me/e-44h