On 28/08/2019 10:33, Nikita Popov wrote:
https://wiki.php.net/rfc/engine_warnings

I am 100% behind the exception proposals, however I did want to discuss the warnings.

I am personally of the belief that there should be a distinction made between notices / warnings issued by the engine, and those issued by extensions, including standard.

I am one of a large number of developers that enforces a "No notice or warning" requirement on their codebases. To this end I use a global error handler that converts ANY notice or error to an \Error exception (within our specific code, so excluding anything in /vendor and the likes).

This does however, effect function calls as well, and it's less ideal to have function calls throwing Error, something derived from Exception would make more sense. The issue is which is which.

If this does pass, I was wondering if there would be any appetite for re-using the E_CORE_XXX error error codes specifically to refer to ALL engine warnings, not just those at startup.

Alternatively, the passing of a bitflag to indicate they came from the engine while still preserving the original bit, although that may be more of a BC break due to requiring bitwise mask comparison in existing handlers.

Either way, this this would allow easily differentiating engine warnings that will become more prominent in this RFC, with those contained in PHP_FUNCTION scope.



--
Mark Randall

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to