Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76194 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26291 invoked from network); 27 Jul 2014 11:02:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jul 2014 11:02:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.85 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.85 blu004-omc2s10.hotmail.com Received: from [65.55.111.85] ([65.55.111.85:51110] helo=BLU004-OMC2S10.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/C0-22380-84CD4D35 for ; Sun, 27 Jul 2014 07:02:33 -0400 Received: from BLU436-SMTP64 ([65.55.111.72]) by BLU004-OMC2S10.hotmail.com with Microsoft SMTPSVC(7.5.7601.22712); Sun, 27 Jul 2014 04:02:40 -0700 X-TMN: [2Io+GFZxefApFyupqzpJuSDT7HQG/Gue] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Received: from bobweinandsimac.fritz.box ([78.141.132.157]) by BLU436-SMTP64.smtp.hotmail.com over TLS secured channel with Microsoft SMTPSVC(8.0.9200.16384); Sun, 27 Jul 2014 04:02:37 -0700 Content-Type: multipart/alternative; boundary="Apple-Mail=_C6FBFF80-5FEF-4F92-B4EB-C6981B68F428" MIME-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) In-Reply-To: <53D4BE89.6030606@sugarcrm.com> Date: Sun, 27 Jul 2014 13:02:32 +0200 CC: Nikita Popov , Julien Pauli , Dmitry Stogov , PHP Internals References: <53D42583.9070201@sugarcrm.com> <53D4BE89.6030606@sugarcrm.com> To: Stas Malyshev X-Mailer: Apple Mail (2.1878.2) X-OriginalArrivalTime: 27 Jul 2014 11:02:37.0814 (UTC) FILETIME=[46F5F960:01CFA98A] Subject: Re: [PHP-DEV] Weird constant expression syntax and bug From: bobwei9@hotmail.com (Bob Weinand) --Apple-Mail=_C6FBFF80-5FEF-4F92-B4EB-C6981B68F428 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" Am 27.7.2014 um 10:55 schrieb Stas Malyshev : > Hi! >=20 >> Yes, I agree that this is not correct behavior - and I don't really >> understand why it was introduced and why it isn't trivial to fix. >> PHP-5.5 had a check for this case in place >> (http://lxr.php.net/xref/PHP_5_5/Zend/zend_compile.c#7071) and phpng >> contains an AST-compatible variant of the array check >> (http://lxr.php.net/xref/phpng/Zend/zend_compile.c#7776). Shouldn't >> copying the condition from phpng into PHP-5.6 resolve this issue? >=20 > I agree it should be easy to fix it this way, but I'd like for Bob to > provide a bit more input here as to best way to resolve it. I'm not = sure > why usage of arrays in runtime is disallowed now in 5.6 code, so I'm = not > sure if we should enable it or remove it. >=20 > If we don't find another way soon, I guess porting one from phpng is > what we'll have to do. > --=20 > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ The AST compatible fix in phpng is just for top-level arrays, but not = for something like "constant ? [1] : [2]". I think we should just enable it, that would lower the level of = confusion. I totally agree that current status isn't optimal. Bob= --Apple-Mail=_C6FBFF80-5FEF-4F92-B4EB-C6981B68F428--