class MyClass
{
const MY_CONSTANT = 'value';
}
class AnotherClass
{
public $prop;
public function __construct()
{
$this->prop = new MyClass();
}
}
$instance = new AnotherClass();
echo $instance->prop::MY_CONSTANT; // Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM)