3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { public function can($name) { return call_user_func(array($name, 'test')); } public static function __callStatic($name, $args) { return 'User::__callStatic'; } public function __call($name, $args) { return 'User::__call'; } } class Foo { public function can($name) { return call_user_func(array($name, 'test')); } public static function __callStatic($name, $args) { return 'Foo::__callStatic'; } public function __call($name, $args) { return 'Foo::__call?'; } } function can($name) { return call_user_func(array($name, 'test')); } $u = new User(); $f = new Foo(); var_dump($u->can('User')); var_dump($u->can('Foo')); var_dump($f->can('User')); var_dump($f->can('Foo')); var_dump(can('User')); var_dump(can('Foo'));
Output for git.master, git.master_jit, rfc.property-hooks
string(12) "User::__call" string(17) "Foo::__callStatic" string(18) "User::__callStatic" string(12) "Foo::__call?" string(18) "User::__callStatic" string(17) "Foo::__callStatic"

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:
101.16 ms | 405 KiB | 5 Q