Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75155 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51250 invoked from network); 30 Jun 2014 21:28:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2014 21:28:05 -0000 Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.167 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.167 blu004-omc4s28.hotmail.com Received: from [65.55.111.167] ([65.55.111.167:62057] helo=BLU004-OMC4S28.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/25-19922-466D1B35 for ; Mon, 30 Jun 2014 17:28:04 -0400 Received: from BLU436-SMTP258 ([65.55.111.137]) by BLU004-OMC4S28.hotmail.com with Microsoft SMTPSVC(7.5.7601.22712); Mon, 30 Jun 2014 14:28:01 -0700 X-TMN: [Tv3gbvV+xtFrkzzvsQsGDwtQu73UswZV] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Received: from bobweinandsimac.fritz.box ([88.207.214.175]) by BLU436-SMTP258.smtp.hotmail.com over TLS secured channel with Microsoft SMTPSVC(8.0.9200.16384); Mon, 30 Jun 2014 14:27:59 -0700 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 23:27:55 +0200 CC: Dmitry Stogov , Xinchen Hui , David Soria Parra , Julien Pauli , PHP Internals Content-Transfer-Encoding: quoted-printable References: To: Andrea Faulds X-Mailer: Apple Mail (2.1878.2) X-OriginalArrivalTime: 30 Jun 2014 21:27:59.0149 (UTC) FILETIME=[2A4415D0:01CF94AA] Subject: Re: [PHP-DEV] Wired constant expression syntax and bug From: bobwei9@hotmail.com (Bob Weinand) That wasn't in the RFC because there still was the IS_CONSTANT_ARRAY I = removed only months later (and replaced with AST) to fix some bugs. It's only at that moment where I now could add that syntax. Bob Am 30.6.2014 um 23:05 schrieb Andrea Faulds : > On 30 Jun 2014, at 20:06, Dmitry Stogov wrote: >=20 >> Hi Bob, >>=20 >> I'm wondered why you introduced this wired syntax in PHP-5.6. >=20 > Do you mean weird? >=20 >>=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? >=20 > I disagree, it makes perfect sense: >=20 > 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]; > } >=20 > ?: and ? only work when there are just two possibilities. >=20 > 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/