Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82197 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91149 invoked from network); 9 Feb 2015 00:03:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2015 00:03:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.181 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.181 mail-qc0-f181.google.com Received: from [209.85.216.181] ([209.85.216.181:39386] helo=mail-qc0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/BC-26926-D69F7D45 for ; Sun, 08 Feb 2015 19:03:58 -0500 Received: by mail-qc0-f181.google.com with SMTP id p6so4437487qcv.12 for ; Sun, 08 Feb 2015 16:03:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=yVHPk2vz3FWY9dMr5HGVxI/PgzOeMLZ5MTxWzfVe8p0=; b=myCW2MLGfEyTdJZYnM7AQTRU2bxHmq+Z2PbK1f+xxudVhdAv9RGa9dpeQEKnNDwgaA sqPO9x6QTNdjzYZSy+LznMrYJq9bl7fJjqn+mHVdrxkESueiPDmI7oNNCosjlZobmbMO mYm2H8VlCurkMR2exKM7CCa1DM7896aC+TFM6RwNMuW1Vw8GSkqfkKBGc7wgamLRv3hj Lqj/sx5YBKoYaAjmFIGThIcJFQ1GI3QV6RwxFZBOqABpkL7R7KZwE9QjDnC8jIcT776i CUoSHoTPDo5w73S9CngNVbh/pTm4XuPx9dVBhR5dm0xcncV0L1OWHF9BKx2Vbj8wtdWx 7urQ== MIME-Version: 1.0 X-Received: by 10.224.171.67 with SMTP id g3mr27820270qaz.17.1423440235040; Sun, 08 Feb 2015 16:03:55 -0800 (PST) Received: by 10.96.185.37 with HTTP; Sun, 8 Feb 2015 16:03:54 -0800 (PST) In-Reply-To: References: <8703B53E-2C4A-4AC6-95C4-D4F19C6D5221@ajf.me> Date: Mon, 9 Feb 2015 07:03:54 +0700 Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC From: pierre.php@gmail.com (Pierre Joye) hi, On Mon, Feb 9, 2015 at 2:44 AM, Andrea Faulds wrote: > Hi, > > I=E2=80=99m posting this in a new thread since people might (reasonably) = be ignoring further responses to the [VOTE] thread. > > I=E2=80=99m considering a small change to the Scalar Type Hints RFC, spec= ifically about syntax. Quite a few people have said they don=E2=80=99t like= the declare() syntax, and it=E2=80=99s easy to see why. It=E2=80=99s rathe= r verbose, it has all the quirks of declare() (such as block syntax, not re= specting scope), and it=E2=80=99s rather ugly. > > Instead, I=E2=80=99m wondering if the following might be better: > > > Which would be used like so: > > > function foobar(): int { > return 1.0; // error! > } > > It=E2=80=99d be a per-file directive, so there=E2=80=99d be zero mixing o= f modes within one file, and you=E2=80=99d avoid the quirks of declare(). > > It=E2=80=99s also a lot shorter, and it resembles Hack=E2=80=99s syntax: > > > Of course, changing this would mean restarting the vote, but it=E2=80=99s= only been three days, we=E2=80=99re less than a quarter of the way through= voting. > > Thoughts? Thanks! > > (By the way, I=E2=80=99d appreciate it if this thread didn=E2=80=99t turn= into yet another discussion of how and whether scalar type hints are a bad= /good idea. We already have at least four threads on that subject. I=E2=80= =99m just considering a specific change of syntax.) > I am not sure I like this. It is somehow not very phpish :) May I ask why you like to do it? Declare works well and only need a couple of line to make it work like encoding. We may fix as well other related issues, nothing that does not look fixable. Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org