3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new DateTime('2022-11-01 13:30:00', new DateTimezone('America/Lima')); $b = clone $a; echo '$a: ', $a->format(DateTime::ATOM), "\r\n"; echo '$b: ', $b->format(DateTime::ATOM), "\r\n"; echo '$a: @', $a->getTimestamp(), "\r\n"; echo '$b: setTimestamp(', $b->getTimestamp(), ")\r\n"; $a->modify('@' . $a->getTimestamp()); $b->setTimestamp($b->getTimestamp()); var_dump($a, $b);
Output for git.master, git.master_jit
$a: 2022-11-01T13:30:00-05:00 $b: 2022-11-01T13:30:00-05:00 $a: @1667327400 $b: setTimestamp(1667327400) object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-01 18:30:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "America/Lima" } object(DateTime)#2 (3) { ["date"]=> string(26) "2022-11-01 13:30:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "America/Lima" }
Output for rfc.property-hooks
$a: 2022-11-01T13:30:00-05:00 $b: 2022-11-01T13:30:00-05:00 $a: @1667327400 $b: setTimestamp(1667327400) object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-01 18:30:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTime)#2 (3) { ["date"]=> string(26) "2022-11-01 13:30:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "America/Lima" }

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:
876.66 ms | 408 KiB | 5 Q