Re: PHP5 and NON-exceptional error handling
| From: | Bertrand Mansion | Date: | Fri, 09 Jun 2006 08:37:21 +0000 |
| Subject: | Re: PHP5 and NON-exceptional error handling | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-42879@lists.php.net to get a copy of this message | ||
Alan Knowles wrote:
>hasnt trigger_error been 'fixed' to enable objects for non-exceptional
>issues (eg. warnings etc.)
>
>Would using that for those situations not be preferable..??
+1, trigger_error() and set_error_handler() is a lightweight and understandable
solution. The closer to PHP core functions, the better IMO. Greg's solution
provides more features but also means more to know before being able to get
started with PEAR. If you really want to return error codes, you can just
document what your function returns, but in many cases using exceptions is
enough and more powerful.
On the other hand, I am not strongly against Greg's solution since it's only a
set of interfaces. But if nobody uses them, they might endup in Siberia.
--
Bertrand Mansion
Mamasam
Tel : +33 1 48 89 88 26
http://www.mamasam.com
Creative Internet Solutions