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); print (int)$eachOffDuty['startTime']; $duration = round((int)($eachOffDuty['endTime'] - (int)$eachOffDuty['startTime']) / (60*60*24)); print $duration;
Output for 5.2.17 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.1
14999905750