3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php print_r((new DateTime('1914-11-06 00:00:00'))->diff((new DateTime('1915-09-06 01:00:00')))); date_default_timezone_set('Europe/Berlin'); print_r((new DateTime('1914-11-06 00:00:00'))->diff((new DateTime('1915-09-06 01:00:00')))); date_default_timezone_set('Europe/Warsaw'); print_r((new DateTime('1914-11-06 00:00:00'))->diff((new DateTime('1915-09-06 01:00:00'))));
Output for 7.1.0
DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 0 [s] => 0 [f] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 304 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 ) DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 0 [s] => 0 [f] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 304 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 ) DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 24 [s] => 0 [f] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 304 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.24 - 5.4.45, 5.5.8 - 5.6.28, 7.0.0 - 7.0.14
DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 0 [s] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 304 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 ) DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 0 [s] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 304 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 ) DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 24 [s] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 304 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for hhvm-3.10.0 - 3.12.0
DateInterval Object ( ) DateInterval Object ( ) DateInterval Object ( )
Output for 5.4.17 - 5.4.23, 5.5.0 - 5.5.7
DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 0 [s] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 304 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 ) DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 0 [s] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 304 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 ) DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 0 [s] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 304 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.0 - 5.4.16
DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 0 [s] => 0 [invert] => 0 [days] => 304 ) DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 0 [s] => 0 [invert] => 0 [days] => 304 ) DateInterval Object ( [y] => 0 [m] => 10 [d] => 0 [h] => 1 [i] => 0 [s] => 0 [invert] => 0 [days] => 304 )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/Ob3BL on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/Ob3BL on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/Ob3BL on line 3
Process exited with code 255.