1--TEST-- 2Basic class support - defining and reading a class constant. 3--FILE-- 4<?php 5 class aclass 6 { 7 const myConst = "hello"; 8 } 9 10 echo "\nRead class constant.\n"; 11 var_dump(aclass::myConst); 12 13 echo "\nFail to read class constant from instance.\n"; 14 $myInstance = new aclass(); 15 var_dump($myInstance->myConst); 16 17 echo "\nClass constant not visible in object var_dump.\n"; 18 var_dump($myInstance) 19?> 20--EXPECTF-- 21 22Read class constant. 23string(5) "hello" 24 25Fail to read class constant from instance. 26 27Notice: Undefined property: aclass::$myConst in %s on line 12 28NULL 29 30Class constant not visible in object var_dump. 31object(aclass)#%d (0) { 32} 33