3v4l.org

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