Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75452 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66067 invoked from network); 14 Jul 2014 13:29:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2014 13:29:45 -0000 Authentication-Results: pb1.pair.com header.from=jocelyn.fournier@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jocelyn.fournier@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: jocelyn.fournier@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:57732] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/14-43645-84BD3C35 for ; Mon, 14 Jul 2014 09:29:45 -0400 Received: by mail-wi0-f182.google.com with SMTP id d1so2532675wiv.3 for ; Mon, 14 Jul 2014 06:29:41 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=5NCe0N6m5iPeoIZwOMsFo7W65LFIRsJRXMnEqWvDYQc=; b=1Dzp0p13m0smyH5nrg088jaehfi5+fj1kJaWqZIKox1q+K3gD1Dy/P60r3Hlb1SPuV uytpfJnjiSydOz8rlnv0v6OtmDzIOWqYBC8vEHgXoyh7IMl1Vvj0P3ZTKrH+lbOoAAhe BCcifAprVZonQL/sTJujimFLKoKSYVXmGt01/Kfb2KoXHov51c7/cF+B+97XHBlnDp+y ah8WXbjYpwp5Ok5cX68q/VsF1Pck/cXbRDFRSGknyoboTY1iqw0NWWOr/2p6evuC0dVi fgnBMQshFIuGVhp4Z4paVvc0pZWx38H4YSzK+0dTOUo0cgBxaCDC4FGfa2Gj/F1GVMLh L9YA== X-Received: by 10.194.20.230 with SMTP id q6mr19656778wje.43.1405344581517; Mon, 14 Jul 2014 06:29:41 -0700 (PDT) Received: from MacBook-Pro-de-jocelyn-fournier.local (ven06-1-82-234-156-61.fbx.proxad.net. [82.234.156.61]) by mx.google.com with ESMTPSA id hq20sm31261726wib.0.2014.07.14.06.29.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jul 2014 06:29:40 -0700 (PDT) Message-ID: <53C3DB42.7090205@gmail.com> Date: Mon, 14 Jul 2014 15:29:38 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: narf@devilix.net CC: internals@lists.php.net, indeyets@gmail.com, Andrea Faulds References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <16D48604-0C0A-4613-91A4-21392E3A2636@ajf.me> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: jocelyn.fournier@gmail.com (Jocelyn Fournier) Hi, Le 14/07/2014 15:19, Andrey Andreev a écrit : > Hi, > > On Mon, Jul 14, 2014 at 4:12 PM, Alexey Zakhlestin wrote: >> Some people talk about inconsistency, which is introduced by reusing same syntax for "strict parameter types" and "scalar parameter casts”. There’s some truth there. >> Let’s use different syntax. >> >> This might work: >> >> function foo((int) $a) >> { >> var_dump($a); >> } >> >> I would read it as declaration-level casting > > I strongly support this. > > What we currently have with class/array typing is a different behavior > (regardless of the details behind it), and this syntax would make that > noticeable, which is a great thing. Actually both syntax could exists : function foo((int) $a) { => scalar parameter casts syntax function foo(int $a) { => strict type checking syntax (consistant with array / class syntax) I like this approach as well. Jocelyn