3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d1 = strtotime("00:08:27"); $d2 = strtotime("00:01:32"); $summ = $d1 + $d2; echo $d1 . "\n"; echo $d2 . "\n"; echo strtotime($summ) - time(); echo "\n"; echo gmdate("H:i:s", $summ - time()); //$date1 = new DateTime('00:08:27'); //$date2 = new DateTime('00:01:32'); //$diff = $date2->diff($date1); //print_r( $diff )
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.11, 7.2.13 - 7.2.26, 7.3.0 - 7.3.13, 7.4.0 - 7.4.1
1518304107 1518303692 -1518381530 01:31:09
Output for 7.2.12
1518304107 1518303692 -1518381531 01:31:08

preferences:
145.77 ms | 401 KiB | 157 Q