<?php
trait C {
public $FOO = self::NAME . ' FOO';
}
class D {
use C;
const NAME = 'D';
}
class E {
use C;
const NAME = 'E';
}
var_dump(D::$FOO);
var_dump(E::$FOO);
Fatal error: Uncaught Error: Access to undeclared static property D::$FOO in /in/BY8hJ:17
Stack trace:
#0 {main}
thrown in /in/BY8hJ on line 17
Process exited with code 255.
Fatal error: Uncaught Error: Access to undeclared static property: D::$FOO in /in/BY8hJ:17
Stack trace:
#0 {main}
thrown in /in/BY8hJ on line 17
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Fatal error: Access to undeclared static property: D::$FOO in /in/BY8hJ on line 17
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
Parse error: syntax error, unexpected '.', expecting ',' or ';' in /in/BY8hJ on line 4
Process exited with code 255.