Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97445 invoked from network); 11 Aug 2010 19:54:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2010 19:54:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=phpwnd@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=phpwnd@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: phpwnd@gmail.com X-Host-Fingerprint: 209.85.212.170 mail-px0-f170.google.com Received: from [209.85.212.170] ([209.85.212.170:64067] helo=mail-px0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/C2-18548-8FFF26C4 for ; Wed, 11 Aug 2010 15:54:33 -0400 Received: by pxi17 with SMTP id 17so221476pxi.29 for ; Wed, 11 Aug 2010 12:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bFlKYiEcSZahtxZTn32IgdhaFgtZ34pFi1AkWMpcW3E=; b=omJCUren7QQtIlTA2B/Io1yem9MUNwm2JxtL3eFPJAnCN6wMkf3FPJK+9u6gTRKPhk 5dAGJ2ZKZ4BcDPt349n/JHK37e2fgmay3tK8krn1jKrOdGsVAHXm12tczUCvjiYiVGGs GI6b1ZVwcJlzxyoRW3zX3/5dhp3F3YnSMwiJo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=fJYWf9KZ1LMmbZ8f5kboKmnfcvyTBo6pGUa++bAG8F7k4+9JIMbPmRV1ifMAEX8a0V m3x5jR8MNRHGyIS+nWUqor9i1mTKsysHhxjNCkDpPk17Ie63ReHbCNHa3Ik8p/t2chql 9zavw2/r/l3V0P6WFRXacfNQ+cUcgPZn/lHR4= MIME-Version: 1.0 Received: by 10.142.200.20 with SMTP id x20mr12619178wff.256.1281556470169; Wed, 11 Aug 2010 12:54:30 -0700 (PDT) Received: by 10.114.154.9 with HTTP; Wed, 11 Aug 2010 12:54:30 -0700 (PDT) In-Reply-To: <7.0.1.0.2.20100811213714.1540f338@zend.com> 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> Date: Wed, 11 Aug 2010 21:54:30 +0200 Message-ID: To: Zeev Suraski Cc: Stas Malyshev , Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Strict typing From: phpwnd@gmail.com (Josh Davis) On 11 August 2010 20:40, Zeev Suraski wrote: > Josh, > > This too (having both options) was debated many times. =A0Read the archiv= es. 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. > Short version? =A0Strict typing is evil. =A0The only thing that's even wo= rse? > =A0Adding both Strict typing and something else. =A0Why? =A0You get every= thing > 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=3D=3D$b and $a=3D=3D=3Db ar= e 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.