Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34341 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58015 invoked by uid 1010); 3 Jan 2008 20:03:59 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 58000 invoked from network); 3 Jan 2008 20:03:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2008 20:03:59 -0000 Authentication-Results: pb1.pair.com header.from=tomi@cumulo.fi; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=tomi@cumulo.fi; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cumulo.fi from 81.228.11.168 cause and error) X-PHP-List-Original-Sender: tomi@cumulo.fi X-Host-Fingerprint: 81.228.11.168 pne-smtpout4-sn1.fre.skanova.net Solaris 10 (beta) Received: from [81.228.11.168] ([81.228.11.168:53140] helo=pne-smtpout4-sn1.fre.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/8E-20810-EAF3D774 for ; Thu, 03 Jan 2008 15:03:59 -0500 Received: from [192.168.1.3] (84.250.46.16) by pne-smtpout4-sn1.fre.skanova.net (7.3.129) (authenticated as kaisto-9) id 474FD0210018F21C for internals@lists.php.net; Thu, 3 Jan 2008 21:03:38 +0100 Organization: Cumulo Studio To: internals@lists.php.net Date: Thu, 3 Jan 2008 22:01:24 +0200 User-Agent: KMail/1.9.7 References: <200801031903.01980.tomi@cumulo.fi> <477D2CDB.3000005@zend.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200801032201.24355.tomi@cumulo.fi> Subject: Re: [PHP-DEV] RE: Optional scalar type hinting From: tomi@cumulo.fi (Tomi Kaistila) > Broken record perhaps? I am getting a bit tired of this "just use Java > argument", it's perhaps even a bit arrogant. From what I read there is > plenty of people that want type hints for static types - there's a few > patches out there, it doesn't slow down the general case. So why should > we *not* add it? (And yes, I changed my mind) Same here. I am getting generally tired of the attitude some politically-correct people seem to have about writing "javaish" code. What the heck is "javaish" code anyway? Most features that exist in both PHP and Java can also be found in myriad of other languages and it has so far not stopped the development team from adding a feature when it is clearly useful and (most importantly) desired an uncounted number of people. In fact those who oppose the feature seem only capable of doing so with hair-splitting rhetorics. > am I the only one to consider E_FATAL (as generated for class typehints) > makes type hinting useless - given that there is no compile stage at which > to catch typehint related mistakes In principle you are correct. But E_FATAL errors should not happen in a program that is in production use. If they do, it seems someone was not doing their job properly. I am not convinced throwing an exception is the best course of action. If it was, you might make the argument that all errors should be exceptions, while traditionally it is the other way around and changing that is beyond the scope of this thread. I actually like the current "division of labor" when it comes to error handling. When PHP detects an error, it should actually be an error. Exceptions are convenient for the code that you as a PHP developer can throw. They are especially a blessing when writing library code. That way exceptions work for the error management, instead of competing with it. I say use E_WARNING at this stage. If there is some large redecorating with PHP's error handling in the future, it can be changed then. Tomi Kaistila PHP Developer