3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $average = 1357002123 - 1356998400; // 1 day = 24 hours * 60 minutes * 60 seconds = 86400 seconds $days = floor( $average / 86400 ); $hours = floor( $average / 3600 ); $minutes = floor( $average / 60 ); $seconds = $average % 60; print_r(array( 'days' => $days, 'hours' => $hours, 'minutes' => $minutes, 'seconds' => $seconds ) ); ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [days] => 0 [hours] => 1 [minutes] => 62 [seconds] => 3 )