1--TEST-- 2Class protected constant visibility 3--FILE-- 4<?php 5class A { 6 protected const protectedConst = 'protectedConst'; 7 static function staticConstDump() { 8 var_dump(self::protectedConst); 9 } 10 function constDump() { 11 var_dump(self::protectedConst); 12 } 13} 14 15A::staticConstDump(); 16(new A())->constDump(); 17constant('A::protectedConst'); 18 19?> 20--EXPECTF-- 21string(14) "protectedConst" 22string(14) "protectedConst" 23 24Warning: constant(): Couldn't find constant A::protectedConst in %s on line %d 25