3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $factorial = call_user_func( function ($le) { return call_user_func( function ($f) { return $f($f); }, function ($f) use ($le) { return $le(function ($x) use ($f) { return call_user_func($f($f), $x); }); } ); }, function ($factorial) { return function ($x) use ($factorial) { if ($x > 0) { return $x * $factorial($x - 1); } return 1; }; } ); var_dump($factorial(1)); var_dump($factorial(2)); var_dump($factorial(3)); var_dump($factorial(4));
Output for git.master, git.master_jit, rfc.property-hooks
int(1) int(2) int(6) int(24)

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