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

preferences:
35.69 ms | 402 KiB | 5 Q