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 14:15:10 +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  Groups: php.internals 
Request: Send a blank email to internals+get-423@lists.php.net to get a copy of this message
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 :) Andi

« previous php.internals (#423) next »