3v4l.org

run code in 300+ PHP versions simultaneously
<?php $timezone = new \DateTimeZone(\date_default_timezone_get()); $now = new \DateTimeImmutable('now', $timezone); $date = \DateTimeImmutable::createFromFormat('U.u', $now->format('U.u'), $timezone); var_dump($now, $date, $now == $date);
Output for git.master
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2023-09-29 13:58:32.004071" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2023-09-29 11:58:32.004071" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } bool(true)
Output for git.master_jit
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2023-09-29 13:58:32.005361" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2023-09-29 11:58:32.005361" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } bool(true)
Output for rfc.property-hooks
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2023-09-29 13:58:32.003452" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2023-09-29 11:58:32.003452" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } bool(true)

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:
27.43 ms | 409 KiB | 5 Q