3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class CustomDateTimeImmutable extends DateTimeImmutable { public function test(): self { return CustomDateTimeImmutable::createFromInterface(new DateTime()); } public function fromFormat(): CustomDateTimeImmutable|false { return CustomDateTimeImmutable::createFromFormat('H:i:s', '00:00:00'); } } var_dump(get_class((new CustomDateTimeImmutable())->test())); //string(23) "CustomDateTimeImmutable" var_dump(get_class((new CustomDateTimeImmutable())->fromFormat())); //string(23) "CustomDateTimeImmutable"
Output for git.master, rfc.property-hooks, git.master_jit
string(23) "CustomDateTimeImmutable" string(23) "CustomDateTimeImmutable"

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:
56.38 ms | 1259 KiB | 4 Q