3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $time2 = strtotime('13:00 20 September 2014'); $time1 = strtotime('12:00 20 September 2014'); $diff = $time2 - $time1; echo 'Time 1: '.date('jS:F:Y:H:i:s', $time1).'<br>'; echo 'Time 2: '.date('jS:F:Y:H:i:s', $time2).'<br>'; if($diff){ echo 'Diff: '.date('h:i:s', $diff); }else{ echo 'No Diff.'; }
Output for 4.3.0 - 4.3.5, 5.1.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Time 1: 20th:September:2014:12:00:00<br>Time 2: 20th:September:2014:13:00:00<br>Diff: 02:00:00
Output for 4.3.6 - 5.0.5
Time 1: 1st:January:1970:00:59:59<br>Time 2: 1st:January:1970:00:59:59<br>No Diff.