3v4l.org

run code in 300+ PHP versions simultaneously
<?hh function fibonacci($n){ /* * Notice that in PHP, we do not have to declare our variables, nor must we * declare their types. Also see how variables in PHP are prefaced with the * dollar sign. Other than that, this is identical to the C version of this function. */ $a = 0; $b = 1; for ($i = 0; $i < $n; $i++){ printf("%d\n",$a); $sum = $a+$b; $a = $b; $b = $sum; } } fibonacci(10);
Output for git.master, git.master_jit, rfc.property-hooks
<?hh function fibonacci($n){ /* * Notice that in PHP, we do not have to declare our variables, nor must we * declare their types. Also see how variables in PHP are prefaced with the * dollar sign. Other than that, this is identical to the C version of this function. */ $a = 0; $b = 1; for ($i = 0; $i < $n; $i++){ printf("%d\n",$a); $sum = $a+$b; $a = $b; $b = $sum; } } fibonacci(10);

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