3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { const TEST = false; public function test() { var_dump(static::TEST, static::who()); } public function who() { return 'A'; } } class B extends A { const TEST = true; public function test() { A::test(); } public function who() { return 'B'; } } $b = new B; $b->test();
based on edVna
Output for 5.3.20 - 5.6.28, 7.0.1 - 7.2.0
bool(true) string(1) "B"
Output for 7.0.0
bool(false) string(1) "A"