3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt1 = new DateTimeImmutable('2020-07-19 18:30:00', new DateTimeZone('Europe/Berlin')); $dt2 = new DateTimeImmutable('2020-07-19 16:30:00', new DateTimeZone('UTC')); print_r($dt1->diff($dt2));
Output for 8.1rc1 - rc3
DateInterval Object ( [y] => -1 [m] => 11 [d] => 30 [h] => 0 [i] => 0 [s] => 0 [f] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 0 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 8.0.0 - 8.0.12
DateInterval Object ( [y] => 0 [m] => 0 [d] => 0 [h] => 0 [i] => 0 [s] => 0 [f] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 0 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )

preferences:
44.65 ms | 462 KiB | 5 Q