3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { function bb() { echo 'parent-'; } } trait B { function bb() { echo 'trait-'; call_user_func_array("parent::bb", array()); //parent::bb(); } } class C extends A { use B; function bb() { echo 'class-'; B::bb(); parent::bb(); } } $o=new C; $o->bb();
based on 7qj25
Output for 7.0.0 - 7.2.0
class- Deprecated: Non-static method B::bb() should not be called statically in /in/0gMrf on line 21 trait- Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access parent:: when current class scope has no parent in /in/0gMrf on line 12 parent-
Output for 5.6.8 - 5.6.28
class- Deprecated: Non-static method B::bb() should not be called statically, assuming $this from incompatible context in /in/0gMrf on line 21 trait- Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access parent:: when current class scope has no parent in /in/0gMrf on line 12 parent-
Output for 5.4.11 - 5.5.35
class- Strict Standards: Non-static method B::bb() should not be called statically, assuming $this from incompatible context in /in/0gMrf on line 21 trait- Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access parent:: when current class scope has no parent in /in/0gMrf on line 12 parent-
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/0gMrf on line 9
Process exited with code 255.