<?php
/* Define os protocolos com os tempos o quantidade */
$protocolos = [
'tp1' => [
'tempo' => '00:30:00',
'qnt' => 2
],
'tp2' => [
'tempo' => '01:00:00',
'qnt' => 3
],
];
/* Cria uma data com o "timestamp" 0 */
$date = new DateTime("1970-01-01 00:00:00");
foreach($protocolos as $protocolo => $valor) {
/**
* Captura o total de segundos ocorreu entre
* `1970-01-01 00:00:00` e `1970-01-01 "tempo_do_protocolo"`.
*/
$tempo = strtotime("1970-01-01 {$valor["tempo
"]}") * $valor["qnt"];
/**
* Criamos um intervalo de segundos e somamos com a data da variável indicada
*/
$date->add( DateInterval::createFromDateString("{$tempo} seconds") );
}
PD9waHAKCi8qIERlZmluZSBvcyBwcm90b2NvbG9zIGNvbSBvcyB0ZW1wb3MgbyBxdWFudGlkYWRlICovCiRwcm90b2NvbG9zID0gWwogICAgJ3RwMScgPT4gWwogICAgICAgICd0ZW1wbycgPT4gJzAwOjMwOjAwJywKICAgICAgICAncW50JyAgID0+IDIKICAgIF0sCiAgICAndHAyJyA9PiBbCiAgICAgICAgJ3RlbXBvJyA9PiAnMDE6MDA6MDAnLAogICAgICAgICdxbnQnICAgPT4gMwogICAgXSwKXTsKCi8qIENyaWEgdW1hIGRhdGEgY29tIG8gInRpbWVzdGFtcCIgMCAqLwokZGF0ZSA9IG5ldyBEYXRlVGltZSgiMTk3MC0wMS0wMSAwMDowMDowMCIpOwoKZm9yZWFjaCgkcHJvdG9jb2xvcyBhcyAkcHJvdG9jb2xvID0+ICR2YWxvcikgewogICAgCiAgICAvKioKICAgICAqIENhcHR1cmEgbyB0b3RhbCBkZSBzZWd1bmRvcyBvY29ycmV1ICBlbnRyZQogICAgICogYDE5NzAtMDEtMDEgMDA6MDA6MDBgIGUgYDE5NzAtMDEtMDEgInRlbXBvX2RvX3Byb3RvY29sbyJgLgogICAgICovCiAgICAkdGVtcG8gPSBzdHJ0b3RpbWUoIjE5NzAtMDEtMDEgeyR2YWxvclsidGVtcG8iXX0iKSAqICR2YWxvclsicW50Il07CiAgICAKICAgIC8qKgogICAgICogQ3JpYW1vcyB1bSBpbnRlcnZhbG8gZGUgc2VndW5kb3MgZSBzb21hbW9zIGNvbSBhIGRhdGEgZGEgdmFyacOhdmVsIGluZGljYWRhCiAgICAgKi8KICAgICRkYXRlLT5hZGQoIERhdGVJbnRlcnZhbDo6Y3JlYXRlRnJvbURhdGVTdHJpbmcoInskdGVtcG99IHNlY29uZHMiKSApOwp9Cgp2YXJfZHVtcCggJGRhdGUtPmZvcm1hdCgiSDppOnMiKSApOw==