<?php
trait T{
public function test() {
if (defined(self::class . "::X")) {
echo self::X;
}
}
}
class A {
private const X = "xxx";
use T;
}
$a = new A();
$a->test();
Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /in/NQ1f8 on line 10
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/NQ1f8 on line 4
Process exited with code 255.