Re: RFC: Replacing errors with Exceptions
| From: | Richard Lynch | Date: | Mon, 27 Jul 2009 02:45:59 +0000 |
| Subject: | Re: RFC: Replacing errors with Exceptions | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45100@lists.php.net to get a copy of this message | ||
On Fri, July 24, 2009 11:00 am, Matt Wilson 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?
No, it wouldn't.
wtf is $! supposed to mean?!
I don't want to know, actually.
If I wanted to use a language that looks like a cat died on my
keyboard, I'd just switch to perl.
--
Some people ask for gifts here.
I just want you to buy an Indie CD for yourself:
http://cdbaby.com/search/from/lynch