3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function doStuff($number) { return $this->doStuffInternal($number, []); } // would be private/protected, but public for sake of // what I'm talking about 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(3)); // no problem here var_dump($foo->doStuffInternal(3, ['derp!'])); // ah shit, that's why it's private
Output for git.master_jit, git.master, rfc.property-hooks
array(3) { [0]=> int(3) [1]=> int(2) [2]=> int(1) } array(4) { [0]=> string(5) "derp!" [1]=> int(3) [2]=> int(2) [3]=> 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:
51.98 ms | 401 KiB | 8 Q