Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45057 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54527 invoked from network); 21 Jul 2009 16:04:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2009 16:04:53 -0000 Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain l-i-e.com designates 67.139.134.202 as permitted sender) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:2182] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/04-02180-327E56A4 for ; Tue, 21 Jul 2009 12:04:52 -0400 Received: (qmail 23806 invoked by uid 98); 21 Jul 2009 16:04:51 -0000 Received: from localhost by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-2.05 (clamdscan: 0.88.7/9593. Clear:RC:1(127.0.0.1):. Processed in 0.082299 secs); 21 Jul 2009 16:04:51 -0000 Received: from localhost (HELO l-i-e.com) (127.0.0.1) by localhost with SMTP; 21 Jul 2009 16:04:51 -0000 Received: from webmail (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Tue, 21 Jul 2009 11:04:51 -0500 (CDT) Message-ID: <64234.99.18.1248192291.squirrel@www.l-i-e.com> In-Reply-To: <48.78.37812.B23675A4@pb1.pair.com> References: <7.0.1.0.2.20090708224156.0ac5a438@zend.com> <312025EF-84D0-4411-A0A7-4F0379C3105F@pooteeweet.org> <13.B7.23850.208375A4@pb1.pair.com> <20090710132324.GM19636@mint.phcomp.co.uk> <98.71.37812.2D6575A4@pb1.pair.com> <20090710151651.GR19636@mint.phcomp.co.uk> <48.78.37812.B23675A4@pb1.pair.com> Date: Tue, 21 Jul 2009 11:04:51 -0500 (CDT) To: internals@lists.php.net User-Agent: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] Type hinting - Request for Discussion From: ceo@l-i-e.com ("Richard Lynch") On Fri, July 10, 2009 10:50 am, Alban wrote: > Le Fri, 10 Jul 2009 16:16:51 +0100, Alain Williams a écrit : > >> On Fri, Jul 10, 2009 at 10:57:22AM -0400, Alban wrote: >>> Le Fri, 10 Jul 2009 14:23:24 +0100, Alain Williams a écrit : >>> >>> > On Fri, Jul 10, 2009 at 08:45:55AM -0400, Alban wrote: >>> And Exception is better than an Error because this give one chance >>> to >>> programmer for resolving the problem before program be halted. >> >> Not everyone understands try/catch. Perhaps a user supplied >> function_argument_error() could be called if not in a try/catch >> block. > > If user not understand try/catch, he don't use it and the exception, > not > catched, generate an error. I think anybody who is coding with strict/weak/contract type-enforcement/casting is going to understand try/catch/Exceptions... Granted, the people using that code and maybe stuck maintaining it could be in for a steep learning curve. But I don't think an Exception being thrown will be problematic for the original coder using this type-hinting stuff. PS The contract stuff looks kind of cool, but seems too unwieldy for pre-parsers/IDEs/lint type tools, so I'd have to vote "nay" on it, if my svn access to docs gives me a vote... -- Some people ask for gifts here. I just want you to buy an Indie CD for yourself: http://cdbaby.com/search/from/lynch