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(); } } class C extends B { public function test() { A::test(); } } $b = new C; $b->test();
based on 3LFXT
Output for 5.4.10 - 5.6.28, 7.0.1 - 7.2.0
array(3) { [0]=> string(1) "C" [1]=> bool(true) [2]=> bool(false) }
Output for 7.0.0
array(3) { [0]=> string(1) "C" [1]=> bool(false) [2]=> bool(false) }
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/pLAB1 on line 8
Process exited with code 255.