<?php const A = 1; class C { public const D = 1; private const E = 1; } use const A as B; // global constants var_dump(defined('A')); var_dump(defined('\A')); var_dump(defined('\\A')); // good joke var_dump(defined('B')); // false var_dump(defined(A)); // checking the constant value // class constants var_dump(defined('C::D')); var_dump(defined('C::E')); // including visibility
You have javascript disabled. You will not be able to edit any code.