3v4l.org

run code in 300+ PHP versions simultaneously
<?php class return_a{} class return_b{} class return_c{} /** * @method A(): return_a * @method B(): return_b * @method C(): return_c */ class Database { public function method_a($proc_name, $args): return_a { return new return_a($proc_name, $args); } public function method_b($proc_name, $args): return_b { return new return_b($proc_name, $args); } public function method_c($proc_name, $args): return_c { return new return_c($proc_name, $args); } public function __call($function, $args): return_a|return_b|return_c|null { return match ($function) { "A" => $this->method_a($function, $args), "B" => $this->method_b($function, $args), "C" => $this->method_c($function, $args), default => null, }; } } (new Database)->A();
Output for git.master, git.master_jit, rfc.property-hooks

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