3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dt1 = new DateTime($dt_occ); $dt2 = new DateTime($dt_occ); $dt2->modify("+1 day"); $interval = $dt2->diff($dt1); echo $interval->hours;
Output for 5.3.6 - 7.2.0
Notice: Undefined variable: dt_occ in /in/SlnWn on line 2 Notice: Undefined variable: dt_occ in /in/SlnWn on line 3 Notice: Undefined property: DateInterval::$hours in /in/SlnWn on line 6
Output for 5.3.0 - 5.3.5
Notice: Undefined variable: dt_occ in /in/SlnWn on line 2 Notice: Undefined variable: dt_occ in /in/SlnWn on line 3 Fatal error: main(): Unknown property (hours) in /in/SlnWn on line 6
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Notice: Undefined variable: dt_occ in /in/SlnWn on line 2 Notice: Undefined variable: dt_occ in /in/SlnWn on line 3 Fatal error: Call to undefined method DateTime::diff() in /in/SlnWn on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/SlnWn on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/SlnWn on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/SlnWn on line 2