Re: deprecation of set_error_level() callback $errcontext argument

From: Date: Tue, 02 Oct 2018 21:37:29 +0000
Subject: Re: deprecation of set_error_level() callback $errcontext argument
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-103301@lists.php.net to get a copy of this message
On 02/10/2018 15:57, Rasmus Schultz wrote:
I understand the $errcontext argument to the set_error_level() callback was deprecated in 7.2. Apparently, this was deemed "not useful", but what's the alternative?
Digging into the archives, and the RFC [1], there was a bit more to it than "not useful"; capturing all variables in a local scope and making them available somewhere else is problematic when it comes to optimisation and analysis. This is particularly true since PHP has no way of making this data immutable, so any error can theoretically cause any local object to change state without being mentioned. While I can understand the desire to have debugging feature built into the language "out of the box", it may be best left to extensions which can capture the information to a log or wherever without providing the full flexibility of the language to interact with it. [1] https://wiki.php.net/rfc/deprecations_php_7_2#errcontext_argument_of_error_handler Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#103301) next »