3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** vendor/symfony/abc */ namespace Foobar { /* private */ class Wizzbang { } } /** src/Wizzbonk.php */ namespace App { class ExternalClass { public function doStuff(): \Foobar\Wizzbang { return \Foobar\fetchPrivateWizzbang(); } public function accessOtherFizz(): \Foobar\Wizzbang { return new \Foobar\OtherFizz(); } } } namespace Foobar { function fetchPrivateWizzbang() { return new Wizzbang(); } /* private */ class OtherFizz extends Wizzbang { } } namespace { $x = new \App\ExternalClass(); var_dump($x->doStuff()); var_dump($x->accessOtherFizz()); }
Output for git.master, git.master_jit
object(Foobar\Wizzbang)#2 (0) { } object(Foobar\OtherFizz)#2 (0) { }

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:
34.76 ms | 405 KiB | 5 Q