1--TEST-- 2var_dump(ReflectionConstant) 3--EXTENSIONS-- 4zend_test 5--FILE-- 6<?php 7 8define('RT_CONST', 42); 9const CT_CONST = [ 10 'foo' => 'foo', 11 'bar' => ['bar'], 12]; 13 14function dump($r) { 15 var_dump($r); 16 echo $r; 17} 18 19dump(new ReflectionConstant('ZEND_CONSTANT_A')); 20dump(new ReflectionConstant('ZEND_TEST_DEPRECATED')); 21dump(new ReflectionConstant('RT_CONST')); 22dump(new ReflectionConstant('CT_CONST')); 23 24?> 25--EXPECT-- 26object(ReflectionConstant)#1 (1) { 27 ["name"]=> 28 string(15) "ZEND_CONSTANT_A" 29} 30Constant [ <persistent> string ZEND_CONSTANT_A ] { global } 31object(ReflectionConstant)#1 (1) { 32 ["name"]=> 33 string(20) "ZEND_TEST_DEPRECATED" 34} 35Constant [ <persistent, deprecated> int ZEND_TEST_DEPRECATED ] { 42 } 36object(ReflectionConstant)#1 (1) { 37 ["name"]=> 38 string(8) "RT_CONST" 39} 40Constant [ int RT_CONST ] { 42 } 41object(ReflectionConstant)#1 (1) { 42 ["name"]=> 43 string(8) "CT_CONST" 44} 45Constant [ array CT_CONST ] { Array } 46