3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Berlin'); $date = new DateTime(); $date->setDate(2015, 10, 25); $date->setTime(1, 30, 0); $date2 = clone $date; // Add two hours $date->add(new DateInterval('PT2H')); // Add two times one hour $date2->add(new DateInterval('PT1H')); $date2->add(new DateInterval('PT1H')); echo "Spot the difference: ".$date->format(DateTime::ATOM)." <---> ".$date2->format(DateTime::ATOM)."\n";

preferences:
27.66 ms | 402 KiB | 5 Q