3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $t1 = new DateTime('23:00:00'); $t2 = new DateTime('00:00:00'); if ($t2 === (new DateTime('00:00:00'))) { $t2 = new DateTime('tommorrow'); } print_r($t1->diff($t2));
based on LHujt
Output for 7.1.0 - 7.3.0rc3
DateInterval Object ( [y] => 0 [m] => 0 [d] => 0 [h] => 23 [i] => 0 [s] => 0 [f] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 0 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for hhvm-3.18.5 - 3.22.0
DateInterval Object ( )
Output for 5.6.0 - 5.6.30
DateInterval Object ( [y] => 0 [m] => 0 [d] => 0 [h] => 23 [i] => 0 [s] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 0 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )