3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d1 = strtotime(00:08:27); $d2 = strtotime(00:01:32); echo date('H:i:s',$d1 + $d2); //$date1 = new DateTime('00:08:27'); //$date2 = new DateTime('00:01:32'); //$diff = $date2->diff($date1); //print_r( $diff )
Output for 7.1.0 - 7.1.14, 7.2.0 - 7.2.2
Parse error: syntax error, unexpected ':', expecting ',' or ')' in /in/4mofO on line 3
Process exited with code 255.

preferences:
166.86 ms | 1395 KiB | 25 Q