3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $spd = (60 * 60 * 24); $sph = (60 * 60); $spm = (60); $start = date('Y-m-d H:m:s'); $end = date('Y-m-d H:m:s', strtotime($start . ' +13 hours')); $sec_diff = strtotime($end) - strtotime($start); $days = floor($sec_diff / $spd); $hours = ($sec_diff - ($days * $spd)) / $sph; echo $days . " " . $hours; ?>
Output for 4.3.6 - 7.1.0
0 13
Output for 4.3.0 - 4.3.5
-1 14