3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dt1 = new DateTimeImmutable(); $dt2 = $dt1->modify("+1 day"); $interval = $dt2->diff($dt1); echo $interval->hours;
Output for 5.5.8 - 7.1.0
Notice: Undefined property: DateInterval::$hours in /in/uRXHR on line 5
Output for 5.5.0 - 5.5.7
Fatal error: DateTime::diff() must be derived from DateTimeImmutable::diff in Unknown on line 0
Process exited with code 255.
Output for 5.0.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/uRXHR on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/uRXHR on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/uRXHR on line 2