Re: Exceptions and Errors
| From: | Adam Maccabee Trachtenberg | Date: | Tue, 13 Apr 2004 21:18:44 +0000 |
| Subject: | Re: Exceptions and Errors | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9126@lists.php.net to get a copy of this message | ||
On Tue, 13 Apr 2004, George Schlossnagle wrote:
> On Apr 13, 2004, at 4:52 PM, Adam Maccabee Trachtenberg wrote:
> >
> > I guess I'm confused about why some E_ERRORs are now able to be
> > handled in userland, but only by using exceptions.
>
> It's important to note that this is now technically feasible but not
> (yet) part of PHP. (You can actually do it as an extension though. :)
Okay, so it's just an unenabled feature, not an impossible one. :)
> > If these types of errors are now recoverable, shouldn't we let the
> > programmer decide how they want to handle them?
>
> You could, but you'ld break existing scripts that rely on E_ERROR being
> fatal in PHP4-ish code. Since exceptions don't exist in PHP4, using
> them to avoid previously fatal errors doesn't alter any existing
> behavior.
Right. This makes sense. Nobody wants to fix up old programs because
they died in PHP 4, but live in PHP 5. That's a waste of time,
compared to adding another error level.
-adam
--
adam@trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!