3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __call($name, $args) { if (is_callable($this->{$name})) { return call_user_func_array($this->{$name}, $args); } } } $foo = new Foo; $foo->bar = function () { return 1; }; echo $foo->bar();

preferences:
38.2 ms | 402 KiB | 5 Q