3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dateStart = new DateTime('2017-08-01 00:00:00'); $now = new DateTime('now', $dateStart->getTimezone()); $interval = $dateStart->diff($now); print_r($interval);
Output for 7.2.9
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.003039 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.2.8
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.018039 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.2.7
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.018436 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.2.6
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.032822 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.2.5
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.029489 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.2.4
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.00688 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.2.3
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.021058 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.2.2
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.014418 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.2.1
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.01388 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.2.0
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.003333 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.21
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.01316 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.20
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.018916 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.19
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.015566 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.18
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.032436 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.17
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.015983 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.16
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.004948 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.15
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.012475 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.14
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.00929 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.13
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.013472 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.12
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.012171 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.11
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.013317 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.10
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.007866 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.9
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.009048 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.8
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.015749 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.7
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.005783 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.6
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.030371 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.5
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.02739 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.4
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.024102 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.3
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.2
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 31 [f] => -0.042236 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.1
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.005045 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.0
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [f] => -0.006245 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.30, 7.0.0 - 7.0.31
DateInterval Object ( [y] => 0 [m] => 0 [d] => 21 [h] => 8 [i] => 43 [s] => 32 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 21 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for hhvm-3.15.4 - 3.22.0
DateInterval Object ( )