3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f() {} class C { function f() {} static function s() {} function __invoke() { echo "In __invoke()\n"; var_dump(func_get_args()); } } $obj = new C; $anon = function() {}; function check_callable(callable $f) {} echo "f()\n"; check_callable('f'); var_dump(is_callable('f')); echo "C::s()\n"; check_callable(array('C', 's')); var_dump(is_callable(array('C', 's'))); check_callable('C::s'); var_dump(is_callable('C::s')); echo "Closure\n"; check_callable($anon); var_dump(is_callable($anon)); echo "C::__invoke()\n"; check_callable($obj); var_dump(is_callable($obj)); echo "C::f()\n"; check_callable(array($obj, 'f')); var_dump(is_callable(array($obj, 'f')));
Output for git.master, git.master_jit, rfc.property-hooks
f() bool(true) C::s() bool(true) bool(true) Closure bool(true) C::__invoke() bool(true) C::f() bool(true)

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:
61.02 ms | 401 KiB | 8 Q