Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98547 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77546 invoked from network); 15 Mar 2017 21:36:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2017 21:36:08 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.128.173 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.128.173 mail-wr0-f173.google.com Received: from [209.85.128.173] ([209.85.128.173:34962] helo=mail-wr0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F3/E2-38004-5C3B9C85 for ; Wed, 15 Mar 2017 16:36:06 -0500 Received: by mail-wr0-f173.google.com with SMTP id g10so19763010wrg.2 for ; Wed, 15 Mar 2017 14:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=BbZlzbK7DBYigTydAFZCrdUFIf3Mr8YLi0VpEgB9xik=; b=ALDn6zbIqGc4lszI6WR2obVjrLgvi3dfCrPIfaZDhnRqs6j8oIW4fbjqoeu88tnt+s iNvtkaTRblg739mcu+vtcdvWxOMvDtCeuibKu1gWlOSh5vIZMJtqWvKT/pQlp5fqmOeu xY58scceKnhvtbFkHmzWxKs+RrMi02zYOcDdrR+RSRiUZReA8lKFzXqVY9OTsjp8TJVC mTQM9hda4IKojVSAd+WF3o41jYqhEBiS8lvPtI5SfDNezAea72CJEc5lPnH4QDw2f0BS 5V6QzTMzG7YPe6GmcyuAVil1eHmM6EyHf1ZISCp+eOtIKQJaY0f182SMklu2B74+qvJo i8mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=BbZlzbK7DBYigTydAFZCrdUFIf3Mr8YLi0VpEgB9xik=; b=SXQgwS65Gui0LzZou9j/Ub1CXrwDQmWQWItkCLBvrdKqrKBiOdkwF5JE7e6Nmuox8R uVw+7/luzisI8hGurgS1BpASEfqKw7dlc2TqCDDi31YVDxh2RgWeegatyiiIyNteUiiR btSZ49ATdbNvJPUrRFeui99FlGhWIbv7Rn1oH0Ur3u226IwYAivrcdaXLgaj/w2ga0XD YUuxk9JZ3VY2lbrNZ7TfpJ7ZmwN2Sc/5TA83XzlY65/4sFT93TqOX5IflEVp4/m/+dFA +EzVxGuLsdVjzxS6JUYIEZdxKbH+voCF++1PtnUwVmW0dkEYs59Lz478b/UX7lu8B5+E OOnQ== X-Gm-Message-State: AFeK/H3m5fx145u+MTzUYUQpTTIGzbhE4rqJrsfJB0HYg+rmIP4fC9GTJHNqI8xNrAxf5NpiWy/3k9B0eocbuw== X-Received: by 10.223.171.23 with SMTP id q23mr4789825wrc.163.1489613762455; Wed, 15 Mar 2017 14:36:02 -0700 (PDT) MIME-Version: 1.0 Sender: php@golemon.com Received: by 10.223.152.213 with HTTP; Wed, 15 Mar 2017 14:36:01 -0700 (PDT) X-Originating-IP: [73.9.224.155] In-Reply-To: References: Date: Wed, 15 Mar 2017 16:36:01 -0500 X-Google-Sender-Auth: FnR03MYO1X8G0TO_YT0yUGXoy0I Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Unexpected results from constant folding From: pollita@php.net (Sara Golemon) On Wed, Mar 15, 2017 at 4:14 PM, Nikita Popov wrote: > Fixed in 7.1 by > https://github.com/php/php-src/commit/2bba4a0d7f6d5e5712d60bc1cf2119622d837e55. > Thanks! > I personally don't consider a PHP 7.0 backport worthwhile, as this is a long > standing issue (from early PHP 5 days) and the fix will probably be hacky on > 7.0. > Probably not, but I like to think out loud. :) > Note that CT resolving self:: doesn't quite cut it, because you also > have to deal with parent::, which the compiler currently does not track. > It doesn't track the specific ce (because it may not know the real parent until runtime), but we have the extends node which gives us the parent's name and that could be rewritten in the same way as self. > An alternative would be to force a full constant update on any parent CE, to > ensure they will be evaluated in the correct order. Of course, this has > other side effects, because it changes the point in time at which a certain > constant is updated. > Yeah, there's too many edge cases to go down that rabbit hole, and as you say, it's a much older bug than 7.0 even. So best face forwards on this one. -Sara