Re: [PHP-DEV] deprecation of set_error_level() callback $errcontext argument

2018-10-02 Thread Rowan Collins

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]


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



[PHP-DEV] deprecation of set_error_level() callback $errcontext argument

2018-10-02 Thread Rasmus Schultz
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?

I understand that debug_backtrace() reports the arguments on the
call-stack, but... just the arguments - no local vars.

I understand you want people to use a real debugger, but there's also
such a thing as error-handling in production - this information was
logged and was useful in conjunction with Sentry, and probably other
error-handlers.

But this feature has been removed, and there's no alternative?

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