3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
y<?php class A { public function foo() { echo 'bar'; } } trait footrait { public function foo() { var $parent = get_parent_class($this); $parent::foo(); } } class B extends A { public function foo() { echo 'baz'; } use footrait; } $b = new B(); $b->foo();
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'var' (T_VAR) in /in/tb3Ad on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/tb3Ad on line 9
Process exited with code 255.