Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:457 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5676 invoked from network); 29 Mar 2003 12:11:37 -0000 Received: from unknown (HELO nils.bezeqint.net) (192.115.106.38) by pb1.pair.com with SMTP; 29 Mar 2003 12:11:37 -0000 Received: from mr1.bezeqint.net (pip-17.bezeqint.net [192.115.106.17]) by nils.bezeqint.net (Bezeq International SMTP out Mail Server) with ESMTP id A1765168C for ; Sat, 29 Mar 2003 15:10:01 +0300 (IDT) Received: from mail.zend.com (bzq-117-235-230.cust.bezeqint.net [192.117.235.230]) by mr1.bezeqint.net (Mirapoint Messaging Server MOS 3.3.3-GR) with SMTP id AVJ69847; Sat, 29 Mar 2003 15:11:32 +0300 (IDT) Received: (qmail 2208 invoked from network); 29 Mar 2003 12:11:25 -0000 Received: from localhost (HELO zeev-laptop.zend.com) (127.0.0.1) by localhost with SMTP; 29 Mar 2003 12:11:25 -0000 Reply-To: zeev@zend.com Message-ID: <5.1.0.14.2.20030329150401.06b3c688@localhost> X-Sender: zeev@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sat, 29 Mar 2003 15:10:49 +0300 To: Timm Friebe Cc: engine2@lists.zend.com, internals@lists.php.net In-Reply-To: <1048871727.25691.664.camel@localhost> References: <1048781764.25691.593.camel@localhost> <1048781764.25691.593.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [Zend Engine 2] Type hints revisited [IllegalArgumentException instead of E_ERROR] From: zeev@zend.com (Zeev Suraski) 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