Can I ask why you use late static binding while you don't want your constant 
value to be changed/overridden by child classes? IMHO, `self::FOO` is all you 
need.

Personally, I don't use late static binding with class constants since the 
coding standard rule I previously referenced forbids this, but I don't think a 
coding style rule should be our only possibility to disallow constant 
overriding.
After learning about the strange behavior Nikita pointed out, final constants 
would be even more useful than what I initially thought.

I agree we should fix the weird behavior but that’s another topic. My point is 
actually what’s your scenario for a final constant? If you want to make sure 
the value you access are not changed by child class, `self::` can serve the 
purpose already. If you want to make sure 
child classes can access the original value, `parent::` or `ParentClassName::` 
can do the job as well.

Regards,
CHU Zhaowei

Reply via email to