Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49376 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99131 invoked from network); 11 Aug 2010 20:01:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2010 20:01:03 -0000 Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.185 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 212.25.124.185 il-mr1.zend.com Received: from [212.25.124.185] ([212.25.124.185:59392] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/13-18548-C71036C4 for ; Wed, 11 Aug 2010 16:01:02 -0400 Received: from il-gw1.zend.com (unknown [10.1.1.21]) by il-mr1.zend.com (Postfix) with ESMTP id D127950532; Wed, 11 Aug 2010 23:00:43 +0300 (IDT) Received: from LAP-ZEEV.zend.com ([10.1.20.50]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 11 Aug 2010 23:00:56 +0300 Message-ID: <7.0.1.0.2.20100811225519.0ef42c40@zend.com> X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Date: Wed, 11 Aug 2010 22:59:21 +0300 To: Josh Davis Cc: Stas Malyshev , Internals In-Reply-To: References: <1281478269.6608.292.camel@guybrush> <4C61E5CA.5070604@sugarcrm.com> <4C61F3EF.5030409@sugarcrm.com> <4C6241D1.6030909@sugarcrm.com> <4C62DBE9.7090008@sugarcrm.com> <7.0.1.0.2.20100811213714.1540f338@zend.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-OriginalArrivalTime: 11 Aug 2010 20:00:56.0707 (UTC) FILETIME=[E9476D30:01CB398F] Subject: Re: [PHP-DEV] Strict typing From: zeev@zend.com (Zeev Suraski) At 22:54 11/08/2010, Josh Davis wrote: >On 11 August 2010 20:40, Zeev Suraski wrote: > > Josh, > > > > This too (having both options) was debated many times. Read the archives. > >I have already read the archives thank you very much. I'm sure you >have too and you remember that there's never been a consensus. I'm >sure that Derick remembers them as well, yet he restarted the >discussion instead of letting it rot in limbo. Consensus about what? About two similar features with slightly different syntax being a bad thing? I don't think we need consensus for that. That's not up for discussion. It's an axiom for PHP. > > Short version? Strict typing is evil. The only thing that's even worse? > > Adding both Strict typing and something else. Why? You get everything > > that's bad about strict typing, combined with the added confusion of two > > ways of doing similar things. > >That's your opinion and I beg to differ. I find that having both type >of "typehints" is having the best of both world at almost no cost. I >am no more confused by the use of parentheses in a method's >declaration than I am by their use in a if construct, in a new Foo() >instantiation or used anywhere else in PHP. > >Knowing the difference between different constructs is part of >learning a language (just like learning that $a==$b and $a===b are >different) and I don't see librairies meant to be used by beginners >use strict typechecking anyway. In all likelihood, it will only be >used by users and frameworks that want the greatest degree of control >over their own code, possibly using strict typechecking for internal >stuff and "weak" typehinting (smartcasting!) for public APIs. See above. It would do everyone good if they don't just think about themselves and whether they're fine or not with a given feature, but about the impact it would have on the userbase at large. Zeev