1--TEST-- 2Test variations of getting constant values 3--FILE-- 4<?php 5 6/* Use separate classes to make sure that in-place constant updates don't interfere */ 7class A { 8 const X = self::Y * 2; 9 const Y = 1; 10} 11class B { 12 const X = self::Y * 2; 13 const Y = 1; 14} 15class C { 16 const X = self::Y * 2; 17 const Y = 1; 18} 19 20var_dump((new ReflectionClassConstant('A', 'X'))->getValue()); 21echo new ReflectionClassConstant('B', 'X'); 22echo new ReflectionClass('C'); 23 24?> 25--EXPECTF-- 26int(2) 27Constant [ public int X ] { 2 } 28Class [ <user> class C ] { 29 @@ %s 12-15 30 31 - Constants [2] { 32 Constant [ public int X ] { 2 } 33 Constant [ public int Y ] { 1 } 34 } 35 36 - Static properties [0] { 37 } 38 39 - Static methods [0] { 40 } 41 42 - Properties [0] { 43 } 44 45 - Methods [0] { 46 } 47} 48