3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function doStuff($number) { return $this->doStuffInternal($number, []); } public function doStuffInternal($number, array $numbers) { if ($number > 0) { $numbers[] = $number; return $this->doStuffInternal($number - 1, $numbers); } return $numbers; } } $foo = new Foo(); var_dump($foo->doStuff(10)); // no problem here var_dump($foo->doStuffInternal(10, ['herp!'])); // ah shit
Output for git.master, git.master_jit, rfc.property-hooks
array(10) { [0]=> int(10) [1]=> int(9) [2]=> int(8) [3]=> int(7) [4]=> int(6) [5]=> int(5) [6]=> int(4) [7]=> int(3) [8]=> int(2) [9]=> int(1) } array(11) { [0]=> string(5) "herp!" [1]=> int(10) [2]=> int(9) [3]=> int(8) [4]=> int(7) [5]=> int(6) [6]=> int(5) [7]=> int(4) [8]=> int(3) [9]=> int(2) [10]=> int(1) }

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