Re: use PEAR::isError()
| From: | Bertrand Mansion | Date: | Sun, 06 Feb 2005 10:50:36 +0000 |
| Subject: | Re: use PEAR::isError() | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-35971@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
>Alan Knowles wrote:
>> or doing this is an option.
>> if (is_a($foo,'PEAR_Error')) {
>> which is faster, and doesnt require PEAR to be loaded..
>Especially since is_a() is deprecated already for PHP5.
This is indeed a stupid move. I see is_a() everywhere today, both in my code and
in other's code. Marking it deprecated for no valid reason, is stupid and makes
everyone unhappy. Especially since it is replaced by a PHP5 only syntax.
>> ....roll on exceptions....
>
>Thats a different topic entirely and fairly unrelated to my post.
>Aside from that people are severely kidding themselves about the
>benefits of exceptions. When things boil down to it they safe you a few
>if's while sacrificing alot of flexibility.
I have used exceptions recently in my code and they really make my life easier.
I think you will change your mind too :) They are also much more appropriate
than PEAR_Errors and should replace them IMO.
Bertrand Mansion
Mamasam