3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Subclass extends DateTimeImmutable { public function __construct(...$args) { parent::__construct(...$args); var_dump("construct"); } public function __clone() { var_dump("clone"); } } $foo = new Subclass('2022-05-05 12:12:13'); var_dump($foo); $foo2 = $foo->modify('+7 days'); echo get_class($foo2), "\n"; var_dump($foo2);
Output for git.master, git.master_jit, rfc.property-hooks
string(9) "construct" object(Subclass)#1 (3) { ["date"]=> string(26) "2022-05-05 12:12:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(5) "clone" Subclass object(Subclass)#2 (3) { ["date"]=> string(26) "2022-05-12 12:12:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }

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:
26.21 ms | 406 KiB | 5 Q