Re: Error_Raise API change, major 2x speedup question
| From: | Alan Knowles | Date: | Sat, 16 Aug 2003 04:02:20 +0000 |
| Subject: | Re: Error_Raise API change, major 2x speedup question | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-19864@lists.php.net to get a copy of this message | ||
OK, ignoring the PHP5 issue, since debug_backtrace is in PHP4.3 - is there any advantage in the new error handler over adding the isErrorType logic to the current PEAR_Error, described below..?
Regards
Alan
Greg Beaver wrote:
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-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com