Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49295 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88123 invoked from network); 10 Aug 2010 23:08:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Aug 2010 23:08:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=crocodile2u@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=crocodile2u@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: crocodile2u@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:59825] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/50-20356-7FBD16C4 for ; Tue, 10 Aug 2010 19:08:40 -0400 Received: by qwb8 with SMTP id 8so9646560qwb.29 for ; Tue, 10 Aug 2010 16:08:37 -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:content-type :content-transfer-encoding; bh=6LOmi/jcgzDDMszn+4uiDIvT5N8W/qzv3Yb3GesH1LU=; b=PLDWLSQYoPHUyD6mUPK3KNeiJkVJnXRB4XYzP7qP9OY1keBcxJRD1aZ6hwRMvjFTwV 1qhMXqNC1nKgYNq26cwbRussLoD+R9z7TeLeDrqLXs2KtQRO41urGV7ayK0VYGHD5VKe A05Y2CMtq5JRsZa9whMcF9qbaH0SIOtPE/2DI= 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 :content-type:content-transfer-encoding; b=LSc2fh3c9rKiC4Ruf7auXRjlEsCBD9Fkotdh4rd/Xrvy5QkWBGW5olU5r6gau1L4NT A5gSNmLdxJY3mhGjFqdnn7eqpNoV2XU1lHYjWCuEahK8Rj4jdlIVeNsxQvXo2JKCXDPN Bo75xVIvQNZLqDkdwNrb51tnQZnEjLiH7MYw8= MIME-Version: 1.0 Received: by 10.229.11.18 with SMTP id r18mr8823738qcr.281.1281481717195; Tue, 10 Aug 2010 16:08:37 -0700 (PDT) Received: by 10.229.221.82 with HTTP; Tue, 10 Aug 2010 16:08:37 -0700 (PDT) In-Reply-To: <4C61D6D0.90907@sugarcrm.com> References: <1281478269.6608.292.camel@guybrush> <4C61D6D0.90907@sugarcrm.com> Date: Wed, 11 Aug 2010 03:08:37 +0400 Message-ID: To: Internals Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Strict typing (was: Typehints) From: crocodile2u@gmail.com (Victor Bolshov) Having two similar syntaxes that work differently - would make the situation even worse that it is now - I beleive. And I totally agree with Rasmus - strict typed language mustnt be called PHP. (Just a poor user's notice to all of you internals' geeks out there) 2010/8/11 Stas Malyshev : > Hi! > >> 1. right now we *have* strict type checks for classes and arrays in the >> =9A =9Aform of "classname" or "array" > > Because classes and arrays were never intechangeable types and there was > never implicit or explicit conversion between SplRecursiveTreeIterator an= d > Zend_Pdf_Generator - it doesn't even make sense to suggest it. There alwa= ys > was conversion between int and string or int and bool. These two things a= re > completely different. > >> 2. the strict scalary type hint patch reuses this same syntax in the >> =9A =9Aform of =9Ato do the same thing in function arguments > > It's not a good thing. As I mentioned, primitive types and classes are ve= ry > different in their use cases and established patterns in PHP. Primitive > types are largely interchangeable, classes are not. (As for arrays, array= s > really should be a class by their usage patterns etc. but for historic > reasons... you know) > >> 3. we have casting type hints in the rest of the code in the form of >> =9A =9A"(int)". > > Just to make it simpler and less confusing, of course. It's nothing like > language having two features that look almost exactly the same but work i= n > different way, and using plenty of ()s is an added bonus for all Lisp fan= s > out there. > >> Some people don't like strict typehints, but the syntax as it currently >> is regarding type hints is *consistent*. Now, to allow both strict and >> casting hints, the logical step seems to be, to give the weak typehint >> advocates their tool as well: > > Calling something that works completely differently from all the establis= hed > patterns of PHP - like internal functions, etc. - "*consistent*" requires > totally new definition of this word. > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 =F3 =D5=D7=C1=D6=C5=CE=C9=C5=CD, =F7=C9=CB=D4=CF=D2