3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new \DateTime('2021-03-01 00:00:00', new \DateTimeZone('Europe/Berlin')); $b = new \DateTime('2021-06-01 00:00:00', new \DateTimeZone('Europe/Berlin')); var_dump($a->diff($b));
Output for 8.2.15
object(DateInterval)#3 (10) { ["y"]=> int(0) ["m"]=> int(3) ["d"]=> int(0) ["h"]=> int(0) ["i"]=> int(0) ["s"]=> int(0) ["f"]=> float(0) ["invert"]=> int(0) ["days"]=> int(92) ["from_string"]=> bool(false) }
Output for 8.1.1
object(DateInterval)#3 (16) { ["y"]=> int(0) ["m"]=> int(3) ["d"]=> int(0) ["h"]=> int(0) ["i"]=> int(0) ["s"]=> int(0) ["f"]=> float(0) ["weekday"]=> int(0) ["weekday_behavior"]=> int(0) ["first_last_day_of"]=> int(0) ["invert"]=> int(0) ["days"]=> int(92) ["special_type"]=> int(0) ["special_amount"]=> int(0) ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> int(0) }
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.24, 8.0.0 - 8.0.11
object(DateInterval)#3 (16) { ["y"]=> int(0) ["m"]=> int(3) ["d"]=> int(3) ["h"]=> int(0) ["i"]=> int(0) ["s"]=> int(0) ["f"]=> float(0) ["weekday"]=> int(0) ["weekday_behavior"]=> int(0) ["first_last_day_of"]=> int(0) ["invert"]=> int(0) ["days"]=> int(92) ["special_type"]=> int(0) ["special_amount"]=> int(0) ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> int(0) }

preferences:
83.04 ms | 403 KiB | 71 Q