3v4l.org

run code in 500+ PHP versions simultaneously
<?php $fibonnacci = function (int $n, $previous2 = 0, $previous1 = 1) { if ($n <= 1) { return $previous2 + $previous1; } $closure = Closure::getCurrent(); return $closure($n - 1, $previous1, $previous1 + $previous2); }; print $fibonnacci(4);
Output for git.master_jit, git.master
5

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:
61.62 ms | 522 KiB | 4 Q