3v4l.org

run code in 300+ PHP versions simultaneously
<?hh function fibonacci(int $n): int { /* * 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(1000);
Output for git.master, git.master_jit, rfc.property-hooks
<?hh function fibonacci(int $n): int { /* * 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(1000);

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.52 ms | 402 KiB | 8 Q