Bug #66252 [NEW]: Problems in AST evaluation invalidating valid parent:: reference
From: Terry at ellisons dot org dot uk
Operating system: N/A
PHP version: master-Git-2013-12-10 (Git)
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Problems in AST evaluation invalidating valid parent:: reference
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 bug report at https://bugs.php.net/bug.php?id=66252&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66252&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66252&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66252&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66252&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66252&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66252&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66252&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66252&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66252&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66252&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66252&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66252&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66252&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66252&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66252&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66252&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66252&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66252&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66252&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66252&r=mysqlcfg
Thread (3 messages)
- Terry at ellisons dot org dot uk