3v4l.org

run code in 300+ PHP versions simultaneously
<?php function add(int $a, int $b): int { return $a + $b; } $c = Closure::fromCallable('add'); $r = new ReflectionFunction($c); echo $r; $c = fn(...$args) => add(...$args); $r = new ReflectionFunction($c); echo $r;
Output for git.master, git.master_jit, rfc.property-hooks
Closure [ <user> function add ] { @@ /in/XBOmJ 3 - 3 - Parameters [2] { Parameter #0 [ <required> int $a ] Parameter #1 [ <required> int $b ] } - Return [ int ] } Closure [ <user> function {closure} ] { @@ /in/XBOmJ 9 - 9 - Parameters [1] { Parameter #0 [ <optional> ...$args ] } }

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:
57.59 ms | 402 KiB | 8 Q