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 'trigger_error' or 'throw'. But alas that's not > possible.
function throw_exception($message, $level = 0) { throw new Exception($message, $level); } ;-) For the record I think that the PHP errors vs. exceptions model kinda sucks, but I also think that what you propose is even worse (no offence). > Also, I think it'd be useful if developers could specificy which line > number and file name the error [...] displays This I could kind of go with. In particular it would be good to control the file/line no *printed* without affecting the stack trace. If this is done though, I would only want to specify how far up the call stack to go to get this information, rather than actually specifying the values used. Best Regards Chris Wright (DaveRandom) -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php