Re: type hinting throwing a fatal error
| From: | Derick Rethans | Date: | Thu, 11 Aug 2005 07:55:12 +0000 |
| Subject: | Re: type hinting throwing a fatal error | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-17820@lists.php.net to get a copy of this message | ||
On Wed, 10 Aug 2005, Zeev Suraski wrote:
> Calling to a function with the wrong arguments is something that should be
> dealt with when developing the application, not at runtime. I think that
> throwing exceptions in all sorts of places encourages people to write
> 'exception-oriented' apps, which is very messy. Type hinting is also not
> exactly an OO thing, it's an object thing, and there's a difference. PHP is
> filling up with a lot of builtin classes, as well as infrastructure classes,
> that actually simplify the lives of users, without them having to have a clue
> about object orientation. Some examples that come to mind are SimpleXML, the
> SOAP classes and PDO. On a long enough timescale - everybody using PHP will
> be using objects, and many (if not most) of them will be using them in
> procedural apps. I see a big negative point in forcibly introducing these
> people to the concept of exceptions.
I agree a 100% here.
> I believe we mentioned once the possibility of adding another error level,
> which is fatal - but still catchable by set_error_handler(). That is a good
> idea (which we should be doing either way).
That would work well. I just want the type hints to be catchable.
regards,
Derick