When are const definitions bound to the variable, and when are parent class variables looked at?
When you have
PHP Code:
class A {
const thing = "other";
protected $var = "stuff";
function __construct()
{
}
}
when is thing bound to "other" and $var bound to be "stuff"? Is it when A is instantiated (ie just before the constructor is called?)?
If that's the case, Test2 is instantiated, and all default variable definitions are looked at and set just before the constructor is called for it. In which case, which order are default variables viewed in? ie, does it look at the child first, then further up the tree to the parent? Which would explain this behaviour (Test2::VERSION being defined, then Test1::VERSION overwriting it).
Either way, I also think it should throw an error about trying to redefine a const
