Sorry for top post, on my android. I disagree that php has perl phobia, but
I agree that a alternative to errors needs to be made. Your example is nice
but might have some tricky implementation details if php continued to throw
errors when it didn't detect $!. I.E. fopen(...) or throw new
CustomException($!); when custom exception writes to a log file that also
writes to $! Perhaps for file not found, For example, does the first fopen
throw the error or supress it as the user likely wanted. However it becomes
a moot point if errors are still thrown.

On Jul 24, 2009 9:01 AM, "Matt Wilson" <sha...@gmail.com> wrote:

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' wrot...

Reply via email to