Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Type hints revisited [IllegalArgumentException instead of E_ERROR]

From: Date: Fri, 28 Mar 2003 13:59:23 +0000
Subject: Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Type hints revisited [IllegalArgumentException instead of E_ERROR]
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-424@lists.php.net to get a copy of this message
On Fri, 2003-03-28 at 09:15, Andi Gutmans wrote: > At 08:42 AM 3/28/2003 -0500, Sterling Hughes wrote: > >This again gets to my nit regarding runtime features in a dynamically > >typed language. One of the reasons type checking in C, C++, Java is a > >good thing is its done at compile time, not runtime. Type mistakes, > >especially in large libraries can be pesky things, often hard to check > >for (and often harmless). A PHP script should not automagically bail > >out on a type mismatch. I think that if this called in a try {} loop > >an exception should be thrown (will this be achieved by George's patch?) > > You just said that the fact that C, C++ and Java make it a fatal error at > compile-time is a good thing. > And I strongly disagree that a type mistake is often harmless if the author > specifically specified the type he wants. If you think it's harmless then > don't use type hints. > Guys, I'm starting to get rundown by this arguing. I am extremely worried > about the current trend of wanting PHP to support everything Java supports. > I think this is the wrong direction for PHP and I think it doesn't reflect > the needs of the majority of PHP users but the academic interest of purists > on this list. You are loosing sight of where PHP comes from and what the > majority of our user base is. > I seriously mean it, that if you are looking for a language with all of the > features of Java then you can just go to java.sun.com. I hear that .jsp is > really good :) > Pah, we all know the future is psp (http://www.edwardbear.org/mod_psp-0.3.tar.gz ;-) Just to be clear: I'd be happier without type hinting then type hinting throwing an E_ERROR (a E_WARNING would also make me happy). The problem I have is the 1% of the time where a type mismatch doesn't get caught, running normal code on a production site, and it causes a bailout. I can imagine that's going to cause quite a few errors (display_errors off, hard to reproduce bug). -Sterling -- "Science is like sex: sometimes something useful comes out, but that is not the reason we are doing it." - Richard Feynman

« previous php.internals (#424) next »