3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new \DateTime('2020-01-01 12:34:56 UTC'); $b = clone $a; var_dump($a, $b, $a === $b);
Output for 8.1.23 - 8.1.34, 8.2.10 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2020-01-01 12:34:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTime)#2 (3) { ["date"]=> string(26) "2020-01-01 12:34:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } bool(false)

preferences:
66.89 ms | 878 KiB | 4 Q