3v4l.org

run code in 150+ 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 - 5.6.28, 7.0.0 - 7.1.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 hhvm-3.12.0
Notice: Undefined variable: dt_occ in /in/SlnWn on line 2 Notice: Undefined variable: dt_occ in /in/SlnWn on line 3 Fatal error: Uncaught exception 'Exception' with message 'Undefined property 'hours) on DateInterval object' in /in/SlnWn:6 Stack trace: #0 /in/SlnWn(6): DateInterval->__get() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
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