3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __call($name, $args) { switch ($name) { case 'bar': return 42; } } } $foo = new Foo(); var_dump(call_user_func([$foo, 'bar'])); $rc = new ReflectionClass(Foo::class); var_dump($rc->getMethods()); var_dump($rm = new ReflectionMethod($foo, 'bar'));
Output for git.master, git.master_jit, rfc.property-hooks
int(42) array(1) { [0]=> object(ReflectionMethod)#3 (2) { ["name"]=> string(6) "__call" ["class"]=> string(3) "Foo" } } Fatal error: Uncaught ReflectionException: Method Foo::bar() does not exist in /in/jqXe6:16 Stack trace: #0 /in/jqXe6(16): ReflectionMethod->__construct(Object(Foo), 'bar') #1 {main} thrown in /in/jqXe6 on line 16
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
82.03 ms | 401 KiB | 8 Q