Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76189 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99684 invoked from network); 27 Jul 2014 08:52:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jul 2014 08:52:17 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.46 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.46 mail-oa0-f46.google.com Received: from [209.85.219.46] ([209.85.219.46:44965] helo=mail-oa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/0F-22380-FBDB4D35 for ; Sun, 27 Jul 2014 04:52:16 -0400 Received: by mail-oa0-f46.google.com with SMTP id m1so7407066oag.19 for ; Sun, 27 Jul 2014 01:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ClcEE70Bg9/WLIwPc0F+EUE65XqlhoRIxH2oU9e5rUk=; b=atXnOe9i0I2No50dY0A3fyPJXjqO09KbJSEEKlzdWMR/7HaTjXP/G5kGglLUIt4Mip z7ijCNt/aB5c/MbwaFZcOMfUx4ns8ncmeZyO3sHDak04k/pZcGzE704FZzZEGFO48yFz 5OCOgkxA8+Qp9n40lKy45cvE13AbuMT9Q2yTP5t9WWUTOK4AxNnzicA8x4f9sibHahEj KoE3H5MLbGyxSWrYgWa95fn4JzRPsjeEcV5lM4LOQcVFPK1bvl3avTehOclA5asyClOo aTA6INa9u14WV/wfiILy0qx8yjA4HN6U1UUkouKr6CR/rfE1tzMb1kfCIxsrqoGQ3XJX xI6w== MIME-Version: 1.0 X-Received: by 10.60.23.65 with SMTP id k1mr39092291oef.20.1406451142521; Sun, 27 Jul 2014 01:52:22 -0700 (PDT) Received: by 10.182.132.2 with HTTP; Sun, 27 Jul 2014 01:52:22 -0700 (PDT) In-Reply-To: <53D42583.9070201@sugarcrm.com> References: <53D42583.9070201@sugarcrm.com> Date: Sun, 27 Jul 2014 10:52:22 +0200 Message-ID: To: Stas Malyshev Cc: Julien Pauli , Dmitry Stogov , Bob Weinand , PHP Internals Content-Type: multipart/alternative; boundary=047d7b33ca42be775004ff28ec2d Subject: Re: [PHP-DEV] Weird constant expression syntax and bug From: nikita.ppv@gmail.com (Nikita Popov) --047d7b33ca42be775004ff28ec2d Content-Type: text/plain; charset=UTF-8 On Sun, Jul 27, 2014 at 12:02 AM, Stas Malyshev wrote: > Hi! > > > Could somebody please clarify what issues are still open here? From what > > I understand, both the opcache issue and the recursion issue are fixed > > now. What's the discussion about? > > As I understand, the issue is that if you define class constant like this: > > class Foo { const Bar = [0]; } > > everything works fine. But if you do var_dump(Foo::Bar), it bombs out > with fatal error (the same goes for every other usage of that constant > in expression). Please correct me if my info is outdated, but I think it > is a behavior that should not be left in the release. If for some reason > we can't make array constants work normally, we should just omit them > altogether. > 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? Nikita --047d7b33ca42be775004ff28ec2d--