<?php
'-05:00:00',
'08:00:00'
);
$seconds = 0;
foreach ( $horas as $hora )
{
if ($g < 0) {
$i *= -1;
$s *= -1;
}
$seconds += $g * 3600;
$seconds += $i * 60;
$seconds += $s;
}
$hours = floor( $seconds / 3600 ); $seconds -= $hours * 3600;
$minutes = floor( $seconds / 60 ); $seconds -= $minutes * 60;
echo "{$hours}:{$minutes}:{$seconds}";
PD9waHAKCiRob3JhcyA9IGFycmF5KAogICAgJy0wNTowMDowMCcsCiAgICAnMDg6MDA6MDAnCik7Cgokc2Vjb25kcyA9IDA7Cgpmb3JlYWNoICggJGhvcmFzIGFzICRob3JhICkKewogICAgbGlzdCggJGcsICRpLCAkcyApID0gZXhwbG9kZSggJzonLCAkaG9yYSApOwogICAgaWYgKCRnIDwgMCkgewogICAgCSRpICo9IC0xOwogICAgCSRzICo9IC0xOwogICAgfQogICAgJHNlY29uZHMgKz0gJGcgKiAzNjAwOwogICAgJHNlY29uZHMgKz0gJGkgKiA2MDsKICAgICRzZWNvbmRzICs9ICRzOwp9CgokaG91cnMgICAgPSBmbG9vciggJHNlY29uZHMgLyAzNjAwICk7CiRzZWNvbmRzIC09ICRob3VycyAqIDM2MDA7CiRtaW51dGVzICA9IGZsb29yKCAkc2Vjb25kcyAvIDYwICk7CiRzZWNvbmRzIC09ICRtaW51dGVzICogNjA7CgplY2hvICJ7JGhvdXJzfTp7JG1pbnV0ZXN9Onskc2Vjb25kc30iOyA=