3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getCallableName(callable $callable) { if (is_string($callable)) { return trim($callable); } else if (is_array($callable)) { if (is_object($callable[0])) { return sprintf("%s::%s", get_class($callable[0]), trim($callable[1])); } else { return sprintf("%s::%s", trim($callable[0]), trim($callable[1])); } } else if ($callable instanceof Closure) { return 'closure'; } else { return 'unknown'; } } getCallableName('foo');
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: getCallableName(): Argument #1 ($callable) must be of type callable, string given, called in /in/YdlTh on line 19 and defined in /in/YdlTh:3 Stack trace: #0 /in/YdlTh(19): getCallableName('foo') #1 {main} thrown in /in/YdlTh on line 3
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:
169.17 ms | 406 KiB | 5 Q