3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class TestParentClass { public function method() { print_r('Parent method'); print "\n"; } } trait TestTrait { public function method() { print_r('Trait method'); print "\n"; } } class TestChildClass extends TestParentClass { use TestTrait { TestTrait::method as methodAlias; method = TestParentClass::method;// insteadof TestTrait; } } (new TestChildClass)->method(); (new TestChildClass)->methodAlias();
Output for 5.4.0 - 5.4.11
Parse error: syntax error, unexpected '=', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /in/6va3i on line 26
Process exited with code 255.
Output for 5.3.0 - 5.3.21
Parse error: syntax error, unexpected T_STRING in /in/6va3i on line 12
Process exited with code 255.