Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75154 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49148 invoked from network); 30 Jun 2014 21:05:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2014 21:05:32 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:60717] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 65/C4-19922-A11D1B35 for ; Mon, 30 Jun 2014 17:05:32 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 56C91B00087; Mon, 30 Jun 2014 17:05:27 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id B6IpTvjDKKQZ; Mon, 30 Jun 2014 17:05:26 -0400 (EDT) Received: from [192.168.0.15] (unknown [90.210.122.167]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 716F7B00085; Mon, 30 Jun 2014 17:05:22 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) In-Reply-To: Date: Mon, 30 Jun 2014 22:05:17 +0100 Cc: Bob Weinand , Xinchen Hui , David Soria Parra , Julien Pauli , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Dmitry Stogov X-Mailer: Apple Mail (2.1878.2) Subject: Re: [PHP-DEV] Wired constant expression syntax and bug From: ajf@ajf.me (Andrea Faulds) On 30 Jun 2014, at 20:06, Dmitry Stogov wrote: > Hi Bob, >=20 > I'm wondered why you introduced this wired syntax in PHP-5.6. Do you mean weird? >=20 > class FooBar { > const bar =3D ["bar" =3D> 3]["bar"]; > } >=20 > It wasn't a part of RFC, it wasn't covered by tests, and it actually > doesn't make a lot of sense. May be it's better to remove it? I disagree, it makes perfect sense: class FooBar { const FOO =3D 3; const BAR =3D [ 3 =3D> =91qux=92, 4 =3D> =91bang=92, 7 =3D> =91theta=92, 9 =3D> =91epsilon=92 ][FOO]; } ?: and ? only work when there are just two possibilities. It is surprising that it wasn=92t in the RFC though, I suspect that was = just an oversight on Bob=92s part. -- Andrea Faulds http://ajf.me/