Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76331 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47528 invoked from network); 4 Aug 2014 09:53:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2014 09:53:05 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.180 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.180 mail-vc0-f180.google.com Received: from [209.85.220.180] ([209.85.220.180:53448] helo=mail-vc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/10-46246-CF75FD35 for ; Mon, 04 Aug 2014 05:53:03 -0400 Received: by mail-vc0-f180.google.com with SMTP id ij19so10598873vcb.11 for ; Mon, 04 Aug 2014 02:53:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ejb1Q3mzX84ZPWthAMeJ4/lBjdOzhIKN2M3GZIUZeeo=; b=VH0jJlnNvVkxuCak1lIlw0yO6F+8gTWfcRtDsSb6vyxJbrTv9ETBiJwGx4x//qclgN 0J+Ca0m4qwHUpfYbBgxhL7oGVw9kpzta6cxslL73QslkDuAq/3DGqu5ooExhnTEcSxCP DHGmu4T5oCTprVN+r0spozdAnnL7y0+hb3h0jnuGe+dRvNEk9TE+R03+lONUz+NQ2VsD 7O5vwwNJABo0MPbN7Y82QJRS5YsAD1kPzZNYTbo6Ymik9cPKiG33BNGSPxyKPkfqGGOz 751IEQZ+8aZ0ZBdFlALgKZNKqjKIKJ1FoqBhfsiXtIE1c15jdYR//G458swUwy3XaPnq X6Cw== X-Gm-Message-State: ALoCoQkK+C1rxoQ/rP/PbJIb9GIhC9InyM+FKRTEpNVrN05TbD5rP0navbarWSE2B167fcUeTKdCyJfOL+wLNj2iYGpN79rvNZFf6G1H+JJviCaJjZwktT0ONwy64Dtt3veji8ynSJyv MIME-Version: 1.0 X-Received: by 10.53.6.132 with SMTP id cu4mr1632141vdd.62.1407146003782; Mon, 04 Aug 2014 02:53:23 -0700 (PDT) Received: by 10.52.110.170 with HTTP; Mon, 4 Aug 2014 02:53:23 -0700 (PDT) In-Reply-To: References: <53D42583.9070201@sugarcrm.com> <53D4BE89.6030606@sugarcrm.com> Date: Mon, 4 Aug 2014 13:53:23 +0400 Message-ID: To: Bob Weinand Cc: Stas Malyshev , Nikita Popov , Julien Pauli , PHP Internals Content-Type: multipart/alternative; boundary=001a1134cc68b3fb8704ffcab51b Subject: Re: [PHP-DEV] Weird constant expression syntax and bug From: dmitry@zend.com (Dmitry Stogov) --001a1134cc68b3fb8704ffcab51b Content-Type: text/plain; charset=UTF-8 Bob, I see you already committed this into PHP-5.6. I would agree that new behavior is more consistent and may be committed into master, but I'm still afraid that it may bring as problems because of last minute changes and lack of tests coverage. Thanks. Dmitry. On Sun, Jul 27, 2014 at 3:02 PM, Bob Weinand wrote: > Am 27.7.2014 um 10:55 schrieb Stas Malyshev : > > Hi! > > 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? > > > 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. > > If we don't find another way soon, I guess porting one from phpng is > what we'll have to do. > -- > 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 > --001a1134cc68b3fb8704ffcab51b--