3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ParentClass{ protected function run(){} public function __call($method,$arguments) { echo "<br/>######Call ". get_called_class()."########<br>"; if(method_exists($this, $method)) { call_user_func_array(array($this,$method),$arguments); } } } class first_child extends ParentClass{ protected function run(){ echo "<br>running " . get_called_class(); $x= new second_child; $x->run(); } } class second_child extends ParentClass{ protected function run(){ echo "<br>running " . get_called_class(); } } $y= new first_child; $y->run();

preferences:
38.7 ms | 402 KiB | 5 Q