1--TEST-- 2Ensure class constants are not evaluated when a class is looked up to resolve inheritance during runtime. 3--FILE-- 4<?php 5 class C 6 { 7 const X = E::A; 8 public static $a = array(K => D::V, E::A => K); 9 } 10 11 eval('class D extends C { const V = \'test\'; }'); 12 13 class E extends D 14 { 15 const A = "hello"; 16 } 17 18 define('K', "nasty"); 19 20 var_dump(C::X, C::$a, D::X, D::$a, E::X, E::$a); 21?> 22--EXPECT-- 23string(5) "hello" 24array(2) { 25 ["nasty"]=> 26 string(4) "test" 27 ["hello"]=> 28 string(5) "nasty" 29} 30string(5) "hello" 31array(2) { 32 ["nasty"]=> 33 string(4) "test" 34 ["hello"]=> 35 string(5) "nasty" 36} 37string(5) "hello" 38array(2) { 39 ["nasty"]=> 40 string(4) "test" 41 ["hello"]=> 42 string(5) "nasty" 43} 44