Bug #66252 [Opn]: Problems in AST evaluation invalidating valid parent:: reference
| From: | laruence@php.net | Date: | Tue, 10 Dec 2013 08:55:05 +0000 |
| Subject: | Bug #66252 [Opn]: Problems in AST evaluation invalidating valid parent:: reference | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183214@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66252&edit=1
ID: 66252
Updated by: laruence@php.net
Reported by: Terry at ellisons dot org dot uk
Summary: Problems in AST evaluation invalidating valid
parent:: reference
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: N/A
PHP Version: master-Git-2013-12-10 (Git)
-Assigned To:
+Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
thanks for spotting this and explained the reason.
Previous Comments:
------------------------------------------------------------------------
[2013-12-10 02:00:38] Terry at ellisons dot org dot uk
Description:
------------
zval_update_constant_ex() evaluates a constant within the scope a class when executed within a class
scope. The new code to support ASTs does not pass this context into the AST evaluator so the class
context is lost and references to self::SOME_CONSTANT and parent::SOME_CONSTANT error.
Test script:
---------------
--TEST--
Terry_002 Problems in AST evaluation invalidating valid parent:: reference
--INI--
opcache.enable=0
opcache.enable_cli=0
opcache.optimization_level=0
--SKIPIF--
--FILE--
<?php
class A { const HW = "this is A"; }
class B extends A { const BHW = parent::HW . " extended by B"; }
const C = B::BHW;
echo C, "\n";
--CLEAN--
--EXPECT--
this is A extended by B
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66252&edit=1