Re: [Zend Engine 2] Type hints revisited [IllegalArgumentException instead of E_ERROR]
| From: | Zeev Suraski | Date: | Sat, 29 Mar 2003 12:10:49 +0000 |
| Subject: | Re: [Zend Engine 2] Type hints revisited [IllegalArgumentException instead of E_ERROR] | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-457@lists.php.net to get a copy of this message | ||
At 07:15 29/03/2003, Timm Friebe wrote:
On Thu, 2003-03-27 at 17:16, 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. [...LONG disussion...] After reading through a bunch of mails this generated, I get the idea that most people here would be happier with an E_WARNING and the function not being executed.?! How the heck can we even think about such a thing? When you call a function, you expect it to run. The code that follows it may rely on stuff that it has done. Not running it is simply not an option, I can't even begin to imagine the possible consequences of such an approach! Type hints are shortcuts for instanceof. If you want to handle a situation where the function is passed the wrong arguments, don't use type hints, use instanceof. Or use the errors-for-exceptions mode that we may have. Zeev