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));
Output for 5.2.17
Parse error: syntax error, unexpected '[' in /in/Bk9DO on line 9
Process exited with code 255.