Hi Johannes Schlueter!
On 08/08/05 14:50 you wrote:

>>> The throw an Exception when SPL disabled and an InvalidArgumentException
>>> when it is enabled.

>>That's senseless when writing applications that shall be version
>>independant. Just sticking to Exception should be fine.

> No it is not, in your application you can still simply catch Exception to be 
> independent of SPL since the InvalidArgumentException class extends the 
> Exception class. But by using nested Exceptions you can catch them 
> independently. Else you would have to catch every Exception, parse the error 
> message or trace to see wether it was a problem while calling the 
> function/method or some code inside the function/method went wrong.

The point is, that it's senseless to have it throw any exception that
can be disabled, when you want to write portable applications. In that
case you still have to stick to catch Exception and have no benefit of
it throwing anything else, when SPL is enabled.

I would pretty much appreciate it having thrown an
InvalidArgumentException, but then this should work everywhere.

Regards,
-- 
Tobias Schlitt - Zend Certified Engineer         GPG Key: 0xA6529579
a passion for php                            http://www.schlitt.info
Like to say "thank you"?    -  http://pear.php.net/wishlist.php/toby

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to