I agree, however there are certain aspects of PHP's errors that leave a lot to be desired. For instance, a failed fopen or a failed socket will often result in an uncatchable warning from php. Sure, you can add a @ to the line but that's slow and doesn't tell you anything about what happened.

I've been saying for years that PHP needs to get over its perl phobia and implement something like $!

fopen("file", "r") or throw new Exception("Error: ". $!);

Wouldn't that be nice?

On Jul 24, 2009, at 10:51 AM, Brian Moon wrote:

On 7/24/09 6:43 AM, Ben Scholzen 'DASPRiD' wrote:
To you both, this is especially, for library code like Zend Framework.

This tends to invalidate your entire argument IMO. Changing the core language because something is hard in an external framework that only a small percentage of actual PHP developers use is not a a good reason.

On 7/24/09 6:40 AM, Kalle Sommer Nielsen wrote:
> I'm a big -1, I don't see a big reason for wrapping all my code in a
> try/catch block when im writing flat out procedural for example, PHP
> isn't an OO-only language

++1 on that.

Brian.

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



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

Reply via email to