Re: Error_Raise API change, major 2x speedup question
| From: | Greg Beaver | Date: | Sat, 16 Aug 2003 02:36:35 +0000 |
| Subject: | Re: Error_Raise API change, major 2x speedup question | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-19863@lists.php.net to get a copy of this message | ||
Alan Knowles wrote:
I thought the general plan was to leave PEAR_Error alone, and try and work out a replacement that uses throw/catch.. in PHP5.. - seems a good point to introduce a major overhall.. Is it really impossible to look up the calling class from debug_backtrace? you could then, just add $error->isErrorType('DB_DATAOBJECT_ERROR_ABCEDFG'); which can exploded on the ERROR, compare it with the class (debug_backtrace) - then compare the error no with the constant($errorstr) Or Did I miss the logic on adding this?Yes. try/catch cannot be used for warnings/notices. Also, you can't assume that people are going to just start using PHP 5, there will be a need for BC. In addition, this code resolves all of the issues with error messages/error codes, which try/catch will never have any power over. Greg