3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** @param callable(int): int $closure */ function takesClosure($closure): int { return $closure(123); } function takesIntByRef(int &$i): int { return $i**2; } takesClosure("takesIntByRef");
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: takesIntByRef(): Argument #1 ($i) cannot be passed by reference in /in/T3J6J:6 Stack trace: #0 /in/T3J6J(14): takesClosure('takesIntByRef') #1 {main} thrown in /in/T3J6J on line 6
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:
37.76 ms | 405 KiB | 5 Q