3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); final readonly class ABC { private const func = static function (int $num): array { return ['num' => $num]; }; static public function doFoo() { var_dump(ABC::func); } } var_dump(ABC::doFoo());
Output for git.master_jit, git.master
object(Closure)#1 (4) { ["name"]=> string(21) "{closure:/in/qhTGS:5}" ["file"]=> string(9) "/in/qhTGS" ["line"]=> int(5) ["parameter"]=> array(1) { ["$num"]=> string(10) "<required>" } } NULL
Output for rfc.property-hooks
Fatal error: Constant expression contains invalid operations in /in/qhTGS on line 5
Process exited with code 255.

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:
155.86 ms | 1086 KiB | 8 Q