3v4l.org

run code in 300+ PHP versions simultaneously
<?php function main() { $callback = function() { return 'foo'; }; echo acceptCallable($callback); echo acceptCallable(['printBar']); } function printBar() { return 'bar'; } function acceptCallable(Callable $callback) { return $callback(); } main();
Output for git.master, git.master_jit, rfc.property-hooks
foo Fatal error: Uncaught TypeError: acceptCallable(): Argument #1 ($callback) must be of type callable, array given, called in /in/V9WUX on line 10 and defined in /in/V9WUX:18 Stack trace: #0 /in/V9WUX(10): acceptCallable(Array) #1 /in/V9WUX(22): main() #2 {main} thrown in /in/V9WUX on line 18
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:
59.57 ms | 401 KiB | 8 Q