Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75578 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75394 invoked from network); 16 Jul 2014 08:41:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2014 08:41:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.177 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.177 mail-wi0-f177.google.com Received: from [209.85.212.177] ([209.85.212.177:57910] helo=mail-wi0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/20-07119-4BA36C35 for ; Wed, 16 Jul 2014 04:41:25 -0400 Received: by mail-wi0-f177.google.com with SMTP id ho1so874713wib.4 for ; Wed, 16 Jul 2014 01:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=J/BsF5dwZQZ7wino+KYGb/F8d0/3Ga1QyEqz1ToEZGw=; b=vjKy8qQLF429CNhMDxe9H0AEDjpbdpNjZa/Uk6lAtx/SkEZRb7Fqzf2NduI4oEP0Aa bGUNTVPKm/ZlVDQP+gbhD9pxuhR//S6r0LGhbnnS6GPYOPR+n1Qs0pOzYpMxdSHe77wc RfUJn0EBRcq/7T+Fo0l8FnfmsRj4V4eh0GLDFkiNGz39aUm41hUTHFlGBRnCvUKE47P9 Q+Q8ysEmHx5PieeE8cDXqwTJNEMOpaRx/9+2nZZFVjVWqwt5/L6cy+spHfgZU2qqWPcn MsCC7xdMLisLJuE3tvx258EFRVQVj1Mo/8n6RQh+g3XMRv1f9RrvIihalxIyb25xO+vW eZOA== X-Received: by 10.180.210.132 with SMTP id mu4mr11557199wic.18.1405499630982; Wed, 16 Jul 2014 01:33:50 -0700 (PDT) Received: from [192.168.0.139] ([62.189.198.114]) by mx.google.com with ESMTPSA id sa4sm38213738wjb.45.2014.07.16.01.33.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Jul 2014 01:33:50 -0700 (PDT) Message-ID: <53C63872.4030404@gmail.com> Date: Wed, 16 Jul 2014 09:31:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "internals@lists.php.net" References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <16D48604-0C0A-4613-91A4-21392E3A2636@ajf.me> <05CE2216-C5D9-4937-9F2E-AA1407284D9F@ajf.me> <53C460DF.5040304@sugarcrm.com> <53C53A96.2040303@gmail.com> <53C55342.1010207@sugarcrm.com> <53C563B3.6060905@gmail.com> <54536191-1B92-4933-973F-0C8289D13A4C@ajf.me> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: rowan.collins@gmail.com (Rowan Collins) Andrey Andreev wrote (on 15/07/2014): > I'm sorry, I know what you mean here and I'm not criticizing you > specifically (in fact, I'm intentionally taking it ouf of context), > but that's "PHP internals", not "PHP community". Point taken, but there's plenty of overlap between the two; it's not like everyone on this list is a 1337 hardcore C hacker who only writes PHP code to test their latest cool patch to the Zend Engine. It would be interesting to have this debate at a PHP conference or large user-group and see if it came out the same way, but I've no particular reason to suppose it wouldn't. > Unless you really force the camps to pick one by saying "you can't > have Y if we've got X" (to which there's no technical limitation, so > that's not true) That's fine, as long as you don't count the syntax as part of the feature. Since everybody would like their preferred version to be written the same way, then, yes, there's a very obvious technical limitation: given function foo(int $bar) there has to be a single interpretation. As soon as that interpretation is chosen, it is chosen for all time, and there is no way we can make it mean something else later. Now, one form of compromise is to use variants of the syntax, such as... function foo((int) $bar) function foo(-int $bar) function foo(+int $bar) function foo(~int $bar) function foo(int! $bar) etc ...but we still have to decide which behaviour to implement first, and which syntax to give it. There's also variants of some of the features that really wouldn't make sense to pick two of: I don't think anyone wants a language which has "weak cast", "strict cast", and "really strict cast" alongside each other. So we can't just say "implement all the versions and let users choose", either. I appreciate the frustration of the debate going round in circles, I feel it too. But without a benevolent dictator, we have to somehow reach a compromise. Feel free to suggest your preferred compromise, as long as it's not "just do the one I want and maybe other people can add theirs later with an as-yet-unspecified syntax" (not that that is what you were asking for, exactly, I've taken it to extremes to make a point). Regards, -- Rowan Collins [IMSoP]