Re: [PHP-DEV] Enable error_handler callback parameters to be passed by reference

2015-01-31 Thread Thomas Bley
error_log() is a good point. In the future, set_error_handler() might be changed to be called multiple times with different custom error handlers, similar to how register_shutdown_function() and spl_autoload_register() act on multiple calls. Having a chain of error handlers appending data to $er

Re: [PHP-DEV] Enable error_handler callback parameters to be passed by reference

2015-01-30 Thread Yasuo Ohgaki
Hi Dan, On Fri, Jan 30, 2015 at 6:38 PM, Dan Ackroyd wrote: > Why can't you just use in the error handler function to write the > exact message you want? > > http://php.net/manual/en/function.error-log.php > Forgot to mention important part. It's perfectly valid to use error_log. I just think l

Re: [PHP-DEV] Enable error_handler callback parameters to be passed by reference

2015-01-30 Thread Yasuo Ohgaki
Hi Dan, On Fri, Jan 30, 2015 at 6:38 PM, Dan Ackroyd wrote: > On 21 January 2015 at 04:39, Thomas Bley wrote: > > In userland it is sometimes necessary to extend PHP's notices/warnings > with additional information (e.g. username from session, stack trace, etc.) > > Why can't you just use in th

Re: [PHP-DEV] Enable error_handler callback parameters to be passed by reference

2015-01-30 Thread Dan Ackroyd
On 21 January 2015 at 04:39, Thomas Bley wrote: > In userland it is sometimes necessary to extend PHP's notices/warnings with > additional information (e.g. username from session, stack trace, etc.) Why can't you just use in the error handler function to write the exact message you want? http:/

Re: [PHP-DEV] Enable error_handler callback parameters to be passed by reference

2015-01-23 Thread reeze
Yeah, seem other want it it too, so I just updated the PR to allow the first four parameters been passed by reference. On 23 January 2015 at 16:23, Nicolas Grekas wrote: > > function myErrorHandler($errno, &$errstr, $errfile, $errline) {...} > > > > It would be awesome to also pass $errfile and

Re: [PHP-DEV] Enable error_handler callback parameters to be passed by reference

2015-01-23 Thread Nicolas Grekas
> function myErrorHandler($errno, &$errstr, $errfile, $errline) {...} > It would be awesome to also pass $errfile and $errline by reference. This would allow mapping "compiled" source to real source code and have meaningful error file+line information. By "compiled", I mean e.g. inlined classes (l

Re: [PHP-DEV] Enable error_handler callback parameters to be passed by reference

2015-01-22 Thread Thomas Bley
Thanks I'll draft a RFC during the weekend. Regards Thomas reeze wrote on 22.01.2015 17:01: > I like the idea, we have the similar scenario, we need to print request log > id to the log, > > > so I just made a PR to implement this: > https://github.com/php/php-src/pull/1018 >

Re: [PHP-DEV] Enable error_handler callback parameters to be passed by reference

2015-01-22 Thread reeze
I like the idea, we have the similar scenario, we need to print request log id to the log, so I just made a PR to implement this: https://github.com/php/php-src/pull/1018 the PR is against master, but I think this could also been in 5.5. On 22 January 2015 at 18:41, Yasuo Ohgaki wrote: > Hi Th

Re: [PHP-DEV] Enable error_handler callback parameters to be passed by reference

2015-01-22 Thread Yasuo Ohgaki
Hi Thomas, On Wed, Jan 21, 2015 at 1:39 PM, Thomas Bley wrote: > In userland it is sometimes necessary to extend PHP's notices/warnings > with additional information (e.g. username from session, stack trace, etc.) > I'm proposing to enable error_handler callback parameters to be passed by > refe

[PHP-DEV] Enable error_handler callback parameters to be passed by reference

2015-01-20 Thread Thomas Bley
In userland it is sometimes necessary to extend PHP's notices/warnings with additional information (e.g. username from session, stack trace, etc.) I'm proposing to enable error_handler callback parameters to be passed by reference to be able to append additional data to error messages. Example: