RE: [PHP-DEV] trigger_error() enhancements

2013-04-16 Thread Chris Wright
At 08 April 2013 21:51 Thomas Anderson wrote: I was thinking it'd be useful if people could switch between throwing exceptions and displaying errors. If throw were a function and not a language construct one could do $function($error) where $function was a string equal to either

[PHP-DEV] trigger_error() enhancements

2013-04-08 Thread Thomas Anderson
I was thinking it'd be useful if people could switch between throwing exceptions and displaying errors. If throw were a function and not a language construct one could do $function($error) where $function was a string equal to either 'trigger_error' or 'throw'. But alas that's not possible. In

Re: [PHP-DEV] trigger_error() enhancements

2013-04-08 Thread Madara Uchiha
What's wrong with set_error_handler()? http://php.net/manual/en/function.set-error-handler.php (Aside for the fact that any uncaught warning would be fatal). On Mon, Apr 8, 2013 at 11:51 PM, Thomas Anderson zeln...@gmail.com wrote: I was thinking it'd be useful if people could switch between

Re: [PHP-DEV] trigger_error() enhancements

2013-04-08 Thread Thomas Anderson
That only addresses my first idea, however, one problem with it I see is that there's not as much fine tuned granularity with it. What if, for error produced by some functions, you wanted to display an HTML page showing the error and other errors you just wanted to silently log it to the DB or