3v4l.org

run code in 300+ PHP versions simultaneously
<?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/kfFBE 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/kfFBE on line 12
Process exited with code 255.

preferences:
176.99 ms | 1386 KiB | 41 Q