3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $eachOffDuty = array(); $eachOffDuty['startTime'] = '1499990575'; $eachOffDuty['endTime'] = '1499990575'; $start_stamp = date("c", $eachOffDuty['startTime']); $start_date = new DateTime($start_stamp); $end_stamp = date("c", $eachOffDuty['endTime']); $end_date = new DateTime($end_stamp); $duration = date_diff($start_date, $end_date);
based on EDbV7
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
Output for 5.2.17
Fatal error: Call to undefined function date_diff() in /in/JQ8O6 on line 9
Process exited with code 255.