<?php
function obterSegundos($tempo){
$horasmins = (int)$tempos[0] * 3600 + (int)$tempos[1] * 60;
return count($tempos) === 2 ?
$horasmins : $horasmins + (int
)$tempos[2]; }
function formatarSegundos($total){
$horas = floor($total / 3600); $minutos = floor(($total - $horas * 3600) / 60); $segundos = $total % 60;
return $segundos ?
sprintf('%02d:%02d:%02d', $horas, $minutos, $segundos): sprintf('%02d:%02d', $horas, $minutos); }
$t1 = "18:00";
$t2 = "08:30:09";
$total = obterSegundos($t1) + obterSegundos($t2);
$t3 = formatarSegundos($total); //26:30:09
PD9waHAKCmZ1bmN0aW9uIG9idGVyU2VndW5kb3MoJHRlbXBvKXsKICAgICR0ZW1wb3MgPSBleHBsb2RlKCI6IiwgJHRlbXBvKTsKICAgICRob3Jhc21pbnMgPSAoaW50KSR0ZW1wb3NbMF0gKiAzNjAwICsgKGludCkkdGVtcG9zWzFdICogNjA7CiAgICByZXR1cm4gY291bnQoJHRlbXBvcykgPT09IDIgPyAkaG9yYXNtaW5zIDogJGhvcmFzbWlucyArIChpbnQpJHRlbXBvc1syXTsKfQoKZnVuY3Rpb24gZm9ybWF0YXJTZWd1bmRvcygkdG90YWwpewogICAgJGhvcmFzID0gZmxvb3IoJHRvdGFsIC8gMzYwMCk7CiAgICAkbWludXRvcyA9IGZsb29yKCgkdG90YWwgLSAkaG9yYXMgKiAzNjAwKSAvIDYwKTsKICAgICRzZWd1bmRvcyA9ICR0b3RhbCAlIDYwOwogICAgcmV0dXJuICRzZWd1bmRvcyA/IAogICAgICAgIHNwcmludGYoJyUwMmQ6JTAyZDolMDJkJywgJGhvcmFzLCAkbWludXRvcywgJHNlZ3VuZG9zKToKICAgICAgICBzcHJpbnRmKCclMDJkOiUwMmQnLCAkaG9yYXMsICRtaW51dG9zKTsKfQogICAgCiR0MSA9ICIxODowMCI7CiR0MiA9ICIwODozMDowOSI7CiR0b3RhbCA9IG9idGVyU2VndW5kb3MoJHQxKSArIG9idGVyU2VndW5kb3MoJHQyKTsKJHQzID0gZm9ybWF0YXJTZWd1bmRvcygkdG90YWwpOyAvLzI2OjMwOjA5Cgp2YXJfZHVtcCgkdDMpOw==