Re: Re: [Zend Engine 2] Type hints revisited [IllegalArgumentException instead of E_ERROR]
| From: | Wez Furlong | Date: | Thu, 27 Mar 2003 21:49:27 +0000 |
| Subject: | Re: Re: [Zend Engine 2] Type hints revisited [IllegalArgumentException instead of E_ERROR] | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-399@lists.php.net to get a copy of this message | ||
Please lets have exceptions here, otherwise you will render type-hints
useless (they are intended primarily for OO programmers anyway).
I'm somewhat concerned that we are implementing a lot of the new OO
features in a half-hearted fashion; I understand that there is a balance
to maintain between easy-accessibility and "enterprise" features.
I've mentioned several times now that unhandled exceptions look just
like E_ERRORS to procedural/non-OO programmers; please can we have the
new OO-related features throw exceptions rather than trigger E_ERRORS as
it allows "real" programmers to write more robust code.
--Wez.
On Thu, 27 Mar 2003, Andi Gutmans wrote:
> At 05:16 PM 3/27/2003 +0100, Timm Friebe wrote:
> >I've implemented an additional feature for type hints that will throw an
> >exception instead of bailing out in case an incorrect type is passed.
>
> I don't see any major advantage in doing this. I think we should keep PHP
> error handling the same as in PHP 4 and leave exceptions in user-land.
> Otherwise we'll end up having an unmanageable hybrid because there's no way
> we're going to change the error-handling of the existing internal
> functions. The majority of our user base is still functional, please don't
> forget this. I feel that people here tend to forget that.