Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82168 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42120 invoked from network); 8 Feb 2015 20:34:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2015 20:34:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.175 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.213.175 mail-ig0-f175.google.com Received: from [209.85.213.175] ([209.85.213.175:42988] helo=mail-ig0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/C2-26926-D38C7D45 for ; Sun, 08 Feb 2015 15:34:06 -0500 Received: by mail-ig0-f175.google.com with SMTP id hn18so12651141igb.2 for ; Sun, 08 Feb 2015 12:34:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=/V3/jvKZzGrXBvSLgLj2xNQdZ/6A3EG4rvy/v8hwI3w=; b=QZDfmcMRyjFlhYlUSeaFMRIDaDhUcdRFp+WuhS/krHHWpT1M7u/7qf0NVXLtqMJM5g lIyei04c2uAf1V2uV9GXOlxg1AYamXek0KIOH8Mk+E1Y0RTIel+sEbF4Wdwfg/mO2cFy GCCUmhX+a3NXf14kNrnfPBT6z6F1lluamKJ9NADhpeXQdhSd5w1UzbFTJiUWO7cfrnlS Fp5dXQFdhBt7kr2XFjYFQI2CR5UJPJBNrhrG1vUA8BiM4elZd+jUpEZHVUNb8aOoEmQM 3potvpSbtLCBV0we0UGQFPsK/SF1xTqQTGh4gJNllvHgMSdstzO3hJAj3wUwdSu6EwdO bgHg== X-Gm-Message-State: ALoCoQmX/DyxKxItgM7pjKCe9Z2/jkTIipxUY3eZ9mGcu1tsUT3+CQhfHqM0pFOVpAYzGJ3iS0phALp9ZIIFF86lxy1PnmWnW3EdDOqLXGZuvuZesxagApcXPypusQCJulv0Sd0UdW9TOeV1NVb2NCFhO3QLwkTrmg== X-Received: by 10.42.211.200 with SMTP id gp8mr7960164icb.93.1423427640376; Sun, 08 Feb 2015 12:34:00 -0800 (PST) References: <8703B53E-2C4A-4AC6-95C4-D4F19C6D5221@ajf.me> In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 thread-index: AQJMIZG9mXkdirFXmuP9r5ZK3xIuzQGdv7Z4m+KL0oA= Date: Sun, 8 Feb 2015 22:33:59 +0200 Message-ID: <048c002a67c3d75afd802025b6946362@mail.gmail.com> 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: zeev@zend.com (Zeev Suraski) FWIW, while I think strict types - stricter than even strict languages - don't belong in PHP, this syntax is clearly a step up from declare(), which was definitely not intended for this purpose. Zeev > -----Original Message----- > From: Andrea Faulds [mailto:ajf@ajf.me] > Sent: Sunday, February 08, 2015 9:45 PM > To: PHP Internals > Subject: [PHP-DEV] Syntactical change to Scalar Type Hints RFC > > 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 de= clare() > syntax, and it=E2=80=99s easy to see why. It=E2=80=99s rather verbose, it= has all the > quirks of > declare() (such as block syntax, not respecting 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 cons= idering a > specific change of syntax.) > > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List To unsubscribe, > visit: > http://www.php.net/unsub.php