3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Something { public function __construct(protected string $a, public int $b) { var_dump(debug_backtrace(limit: 1)); var_dump(func_get_args()); } } $s_ordered = new Something('yo', 1337); var_dump($s_ordered); print "---------------\n"; $s_named = new Something(b: 1337, a: 'yo'); var_dump($s_named);
Output for git.master
/bin/php-git-master: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-git-master) /bin/php-git-master: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-git-master)
Process exited with code 1.
Output for git.master_jit, rfc.property-hooks
array(1) { [0]=> array(7) { ["file"]=> string(9) "/in/17UTb" ["line"]=> int(10) ["function"]=> string(11) "__construct" ["class"]=> string(9) "Something" ["object"]=> object(Something)#1 (2) { ["a":protected]=> string(2) "yo" ["b"]=> int(1337) } ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(2) "yo" [1]=> int(1337) } } } array(2) { [0]=> string(2) "yo" [1]=> int(1337) } object(Something)#1 (2) { ["a":protected]=> string(2) "yo" ["b"]=> int(1337) } --------------- array(1) { [0]=> array(7) { ["file"]=> string(9) "/in/17UTb" ["line"]=> int(15) ["function"]=> string(11) "__construct" ["class"]=> string(9) "Something" ["object"]=> object(Something)#2 (2) { ["a":protected]=> string(2) "yo" ["b"]=> int(1337) } ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(2) "yo" [1]=> int(1337) } } } array(2) { [0]=> string(2) "yo" [1]=> int(1337) } object(Something)#2 (2) { ["a":protected]=> string(2) "yo" ["b"]=> int(1337) }

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:
33.07 ms | 410 KiB | 5 Q