3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $time1 = strtotime('09:00:59'); $time2 = strtotime('09:01:00'); $diff = $time2 - $time1; echo 'Time 1: '.date('H:i:s', $time1).'<br>'; echo 'Time 2: '.date('H:i:s', $time2).'<br>'; if($diff){ echo 'Diff: '.date('H:i:s', $diff); }else{ echo 'No Diff.'; } ?>
Output for 4.3.0 - 5.6.25, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Time 1: 09:00:59<br>Time 2: 09:01:00<br>Diff: 01:00:01