3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); $date2 = new DateTime(" 17 May 2015"); $diff = $date2->diff($date); print_r($diff);
Output for 7.2.6
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 23 [f] => 0.004536 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.2.0
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 23 [f] => 0.005061 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.20
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 23 [f] => 0.003633 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.10
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 23 [f] => 0.004928 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.7
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 23 [f] => 0.004267 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.6
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 23 [f] => 0.012739 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.5
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 23 [f] => 0.011158 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.0
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 23 [f] => 0.003982 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.28, 7.0.20
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 23 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.6
DateInterval Object ( [y] => 0 [m] => 11 [d] => 16 [h] => 20 [i] => 23 [s] => 5 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 352 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.5
DateInterval Object ( [y] => 0 [m] => 10 [d] => 17 [h] => 8 [i] => 41 [s] => 2 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 322 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.4
DateInterval Object ( [y] => 0 [m] => 9 [d] => 22 [h] => 20 [i] => 40 [s] => 47 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 298 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.3
DateInterval Object ( [y] => 0 [m] => 10 [d] => 1 [h] => 22 [i] => 3 [s] => 5 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 306 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.2
DateInterval Object ( [y] => 0 [m] => 10 [d] => 6 [h] => 4 [i] => 17 [s] => 13 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 311 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.1
DateInterval Object ( [y] => 0 [m] => 10 [d] => 7 [h] => 7 [i] => 29 [s] => 43 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 312 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.0
DateInterval Object ( [y] => 0 [m] => 10 [d] => 10 [h] => 9 [i] => 23 [s] => 43 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 315 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.21
DateInterval Object ( [y] => 0 [m] => 11 [d] => 15 [h] => 15 [i] => 31 [s] => 51 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 351 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.20
DateInterval Object ( [y] => 0 [m] => 10 [d] => 24 [h] => 7 [i] => 42 [s] => 37 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 329 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.19
DateInterval Object ( [y] => 0 [m] => 9 [d] => 20 [h] => 4 [i] => 51 [s] => 40 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 296 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.18
DateInterval Object ( [y] => 0 [m] => 9 [d] => 27 [h] => 13 [i] => 43 [s] => 45 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 303 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.17
DateInterval Object ( [y] => 0 [m] => 10 [d] => 3 [h] => 1 [i] => 18 [s] => 8 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 308 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.16
DateInterval Object ( [y] => 0 [m] => 10 [d] => 11 [h] => 10 [i] => 12 [s] => 35 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 316 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.15
DateInterval Object ( [y] => 0 [m] => 10 [d] => 12 [h] => 11 [i] => 1 [s] => 58 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 317 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.14
DateInterval Object ( [y] => 0 [m] => 10 [d] => 28 [h] => 16 [i] => 43 [s] => 7 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 333 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.13
DateInterval Object ( [y] => 0 [m] => 10 [d] => 29 [h] => 17 [i] => 23 [s] => 29 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 334 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.12
DateInterval Object ( [y] => 0 [m] => 11 [d] => 3 [h] => 7 [i] => 50 [s] => 53 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 339 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.11
DateInterval Object ( [y] => 0 [m] => 11 [d] => 7 [h] => 14 [i] => 16 [s] => 21 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 343 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.10
DateInterval Object ( [y] => 0 [m] => 11 [d] => 8 [h] => 16 [i] => 21 [s] => 7 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 344 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.9
DateInterval Object ( [y] => 0 [m] => 11 [d] => 10 [h] => 21 [i] => 29 [s] => 3 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 346 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.8
DateInterval Object ( [y] => 0 [m] => 11 [d] => 13 [h] => 6 [i] => 18 [s] => 42 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 349 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.35
DateInterval Object ( [y] => 1 [m] => 0 [d] => 6 [h] => 0 [i] => 54 [s] => 5 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 372 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.34
DateInterval Object ( [y] => 0 [m] => 10 [d] => 25 [h] => 9 [i] => 54 [s] => 33 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 330 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.33
DateInterval Object ( [y] => 0 [m] => 9 [d] => 21 [h] => 7 [i] => 47 [s] => 50 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 297 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.32
DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 17 [i] => 38 [s] => 49 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 305 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.31
DateInterval Object ( [y] => 0 [m] => 10 [d] => 4 [h] => 4 [i] => 25 [s] => 17 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 309 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.30
DateInterval Object ( [y] => 0 [m] => 10 [d] => 15 [h] => 12 [i] => 54 [s] => 7 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 320 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.29
DateInterval Object ( [y] => 0 [m] => 11 [d] => 0 [h] => 7 [i] => 41 [s] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 336 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.28
DateInterval Object ( [y] => 0 [m] => 11 [d] => 4 [h] => 11 [i] => 8 [s] => 48 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 340 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.27
DateInterval Object ( [y] => 0 [m] => 11 [d] => 5 [h] => 12 [i] => 49 [s] => 18 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 341 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.26
DateInterval Object ( [y] => 0 [m] => 11 [d] => 9 [h] => 19 [i] => 0 [s] => 18 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 345 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.25
DateInterval Object ( [y] => 0 [m] => 11 [d] => 12 [h] => 2 [i] => 25 [s] => 47 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 348 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.24
DateInterval Object ( [y] => 1 [m] => 0 [d] => 7 [h] => 16 [i] => 46 [s] => 14 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 373 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.45
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 26 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.44
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 27 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.42 - 5.4.43
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 29 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.40 - 5.4.41
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 30 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.39
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 31 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.36 - 5.4.38
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 32 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.34 - 5.4.35
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 33 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.3.29, 5.4.31 - 5.4.32
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 34 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.28 - 5.4.30
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 35 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.25 - 5.4.27
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 36 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.3.28, 5.4.22 - 5.4.24
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 37 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.18 - 5.4.21
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 38 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.3.27, 5.4.17
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 39 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 210 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.3.25 - 5.3.26, 5.4.14 - 5.4.16
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 39 [invert] => 0 [days] => 210 )
Output for 5.3.21 - 5.3.24, 5.4.11 - 5.4.13
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 40 [invert] => 0 [days] => 210 )
Output for 5.3.20, 5.4.10
DateInterval Object ( [y] => 0 [m] => 6 [d] => 26 [h] => 18 [i] => 13 [s] => 41 [invert] => 0 [days] => 210 )