Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34347 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79603 invoked by uid 1010); 3 Jan 2008 20:37:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 79587 invoked from network); 3 Jan 2008 20:37:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2008 20:37:03 -0000 Authentication-Results: pb1.pair.com header.from=sam@sambarrow.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sam@sambarrow.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sambarrow.com from 205.234.132.11 cause and error) X-PHP-List-Original-Sender: sam@sambarrow.com X-Host-Fingerprint: 205.234.132.11 scottsdale.servershost.net Received: from [205.234.132.11] ([205.234.132.11:57242] helo=scottsdale.servershost.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/F1-20810-E674D774 for ; Thu, 03 Jan 2008 15:37:02 -0500 Received: from [98.172.154.66] (port=24413 helo=[10.200.100.14]) by scottsdale.servershost.net with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.68) (envelope-from ) id 1JAWoF-0005x5-8K; Thu, 03 Jan 2008 14:36:59 -0600 To: Stanislav Malyshev Cc: Derick Rethans , Markus Fischer , internals@lists.php.net In-Reply-To: <477D452A.9090906@zend.com> References: <200801031903.01980.tomi@cumulo.fi> <1199380881.15292.11.camel@sbarrow-desktop> <20080103172813.GQ7861@mint.phcomp.co.uk> <477D2B40.9010302@fischer.name> <477D2CDB.3000005@zend.com> <477D452A.9090906@zend.com> Content-Type: text/plain Date: Thu, 03 Jan 2008 15:35:31 -0500 Message-ID: <1199392531.15292.64.camel@sbarrow-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - scottsdale.servershost.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sambarrow.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] RE: Optional scalar type hinting From: sam@sambarrow.com (Sam Barrow) On Thu, 2008-01-03 at 12:27 -0800, Stanislav Malyshev wrote: > > patches out there, it doesn't slow down the general case. So why > should > > we *not* add it? (And yes, I changed my mind) > > My opinion is that the language is not a salad of features that somebody > somewhere found useful. The language should have some directions and > properties that make it easy to understand and handy to work with. > Having both strict and non-strict typing in the same language does not > seem like a good idea to me. In a way this is true, but I look at it this way. Some languages are strictly typed, some are dynamically typed. PHP can have the best of both worlds by having optional strict typing where desired, as well as dynamic typing. I have numerous cases where I will have a type hinted parameter and a non type hinted parameter in the same function. This way we can have maximum flexibility where useful, but also control where needed. Keep in mind, this is not "strict typing" in its correct definition. Strict typing allows very little room for type conversion. This is optionally hinting the desired type of a function parameter.