3v4l.org

run code in 300+ PHP versions simultaneously
<?php function tipoHorario($hora, $inicioMatutino, $inicioVespertino, $finMatutino, $finVespertino){ $horaUTC = strtotime($hora); if($horaUTC >= strtotime($inicioMatutino) && $horaUTC < strtotime($finMatutino)) return "Matutino"; else if($horaUTC >= strtotime($finMatutino) && $horaUTC < strtotime($inicioVespertino) ) return "Descanso matutino"; else if($horaUTC >= strtotime($inicioVespertino) && $horaUTC < strtotime($finVespertino)) return "Vespertino"; else return "Descanso vespertino"; } function tipoCaso($hora, $inicioMatutino, $inicioVespertino, $finMatutino, $finVespertino){ $previoFinMatutino = date("H:i", strtotime($finMatutino . " -30 minutes")); $previoFinVespertino = date("H:i", strtotime($finVespertino . " -30 minutes")); //Si cayó el caso entre 14:30 y 15:00 o en Descanso matutino if( strtotime($hora) >= strtotime($previoFinMatutino) && strtotime($hora) < strtotime($finMatutino) || tipoHorario($hora, $inicioMatutino, $inicioVespertino, $finMatutino, $finVespertino) == "Descanso matutino" ){ $cadena = "Caso especial matutino"; //si cayó en un descanso matutino, es decir después las 15:00 y antes de las 16:30 se le sumará directo 30 if(tipoHorario($hora, $inicioMatutino, $inicioVespertino, $finMatutino, $finVespertino) == "Descanso matutino" ) $cadena = $cadena . " en descanso"; //los minutos sobrantes se suman despues de 16:30 return $cadena; } //Si cayó el caso entre las 18:00 y 18:30 o en descanso vespertino if( strtotime($hora) >= strtotime($previoFinVespertino) && strtotime($hora) < strtotime($finVespertino) || tipoHorario($hora, $inicioMatutino, $inicioVespertino, $finMatutino, $finVespertino) == "Descanso vespertino" ){ $cadena = "Caso especial vespertino"; if(tipoHorario($hora, $inicioMatutino, $inicioVespertino, $finMatutino, $finVespertino) == "Descanso vespertino") $cadena = $cadena . " en descanso"; //Los minutos sobrantes se suman después de 09:00 return $cadena; } //Si el caso entró dentro del rango matutino sin el caso especial, es normal matutino if( tipoHorario($hora, $inicioMatutino, $inicioVespertino, $finMatutino, $finVespertino) == "Matutino" ) return "Caso normal matutino"; //Si el caso entró dentro del rango vespertino sin el caso especial, es normal vespertino if( tipoHorario($hora, $inicioMatutino, $inicioVespertino, $finMatutino, $finVespertino) == "Vespertino" ) return "Caso normal vespertino"; } function restaMinutos($horaMayor, $horaMenor){ $resultadoResta = strtotime($horaMayor) - strtotime($horaMenor); echo "Resultado resta $horaMayor - $horaMenor= ". date("i", $resultadoResta)."\n"; return date("i", $resultadoResta); } function minutosSobrantes($offset, $horaMayor, $horaMenor){ $horaMayor = date('H:i', strtotime($horaMayor ) ); $minMenor = restaMinutos($horaMayor, $horaMenor) ; //$resultadoResta = $offset - $minMenor; $minMayor = "00:".$offset.""; $resultadoResta = date("i", strtotime($minMayor. " -".$minMenor." minutes") ); echo "Minutos sobrantes: ". $resultadoResta."\n"; return $resultadoResta; } function obtenerHoraEstimada($hora, $tipoCaso, $inicioMatutino, $inicioVespertino, $finMatutino, $finVespertino, $offset){ $horaEstimada = ""; //Si el tipo de caso es normal X //Solamente se le sumara el offset entero a la hora if( $tipoCaso == "Caso normal matutino" || $tipoCaso == "Caso normal vespertino" ){ echo "Se le sumará el offset entero ".$offset." a ".$hora."\n"; //echo "Hora estimada: " . date('H:i', strtotime($hora . " +30 minutes") ) . "\n"; $horaEstimada = date('H:i', strtotime($hora . " +30 minutes") ); } //sino, hay que ver que tipo de caso especial es else{ //Si es caso especial matutino, hay que calcular los minutos sobrantes y añadirlos a la hora //de inicio vespertina if( $tipoCaso == "Caso especial matutino" ){ echo "Se le sumará el sobrante de ".$offset." a la horaInicioVespertino: " . $inicioVespertino . "\n"; $sobrante= minutosSobrantes($offset, $finMatutino, $hora); //echo "Hora estimada: " . date("H:i", strtotime($inicioVespertino." +".$sobrante." minutes") ); $horaEstimada = date("H:i", strtotime($inicioVespertino." +".$sobrante." minutes") ); } //Si es caso especial matutino en descanso, hay que calcular los minutos sobrantes y añadirlos a la hora //de inicioVespertina else if( $tipoCaso == "Caso especial matutino en descanso" ){ echo "Se le sumará el offset entero ".$offset." a la horaInicioVespertino: " . $inicioVespertino . "\n"; //echo "Hora estimada: " . date('H:i', strtotime($inicioVespertino . " +30 minutes") ) . "\n"; $horaEstimada = date('H:i', strtotime($inicioVespertino . " +30 minutes") ); } //Si es caso especial vespertino, hay que calcular los minutos sobrantes y añadirlos a la hora //de inicioMatutina else if ($tipoCaso == "Caso especial vespertino" ){ echo "Se le sumará el sobrante de ".$offset." a la horaInicioMatutino: " . $inicioMatutino . "\n"; $sobrante = minutosSobrantes($offset, $finVespertino, $hora); //echo "Hora estimada: " . date("H:i", strtotime($inicioMatutino." +".$sobrante." minutes") ); $horaEstimada = date("H:i", strtotime($inicioMatutino." +".$sobrante." minutes") ); } //Si es caso especial vespertina en descanso, hay que calcular los minutos sobrantes y añadirlos a la hora //de inicioMatutina else if( $tipoCaso == "Caso especial vespertino en descanso" ){ echo "Se le sumará el offset entero ".$offset." a la horaInicioMatutino: " . $inicioMatutino . "\n"; //echo "Hora estimada: " . date('H:i', strtotime($inicioMatutino . " +30 minutes") ) . "\n"; $horaEstimada = date('H:i', strtotime($inicioMatutino . " +30 minutes") ) ; } } return $horaEstimada; } function obtenerFechaEstimada($fecha, $noDia){ $offsetFecha = ""; //Si el día de la fecha cayó entre lunes y jueves (inclusive domingo), aumentar 1 día if( ($noDia>= 1 && $noDia <= 4) || $noDia==7) $offsetFecha = " +1 days"; //Si cayó el viernes, aumentar 3 días else if( $noDia == 5 ) $offsetFecha = " +3 days"; //Si hubo el caso en el que cayó el sábado, aumentar 2 días else if( $noDia == 6 ) $offsetFecha = " +2 days"; return date("Y-m-d", strtotime($fecha . $offsetFecha) ); } function checktime($fechaHora, $minutosTolerancia){ $fecha = date("Y-m-d", strtotime($fechaHora)); $horaMinuto = date("H:i", strtotime($fechaHora)); $noDia = date("N", strtotime($fechaHora)); $horaInicioMatutino = "09:00"; $horaFinMatutino = "15:00"; $horaInicioVespertino = "16:30"; $horaFinVespertino = "18:30"; echo "fecha: " . $fecha . "\nhoraMinuto: " . $horaMinuto . "\nnoDia: " . $noDia . "\n\n"; echo "tipoHorario: " . tipoHorario($horaMinuto, $horaInicioMatutino, $horaInicioVespertino, $horaFinMatutino, $horaFinVespertino) . "\n\n"; echo "tipoCaso: " . tipoCaso($horaMinuto, $horaInicioMatutino, $horaInicioVespertino, $horaFinMatutino, $horaFinVespertino) . "\n\n"; $tipoCaso = tipoCaso($horaMinuto, $horaInicioMatutino, $horaInicioVespertino,$horaFinMatutino, $horaFinVespertino); $horaEstimada = obtenerHoraEstimada($horaMinuto, $tipoCaso, $horaInicioMatutino, $horaInicioVespertino, $horaFinMatutino, $horaFinVespertino, $minutosTolerancia ); $fechaEstimada = $fecha; if($tipoCaso == "Caso especial vespertino" || $tipoCaso == "Caso especial vespertino en descanso"){ $tempFechaEstimada = obtenerFechaEstimada($fecha, $noDia); //if lo del feriado $fechaEstimada = $tempFechaEstimada; } echo "Fecha estimada obtenida: " . $fechaEstimada."\n\n"; echo "Hora estimada obtenida: " . $horaEstimada."\n\n"; } checktime("2017-06-15 08:00:00",30); echo "***************************\n\n"; checktime("2017-06-15 09:00:00",30); echo "***************************\n\n"; checktime("2017-06-15 12:50:00",30); echo "***************************\n\n"; checktime("2017-06-15 14:29:00",30); echo "***************************\n\n"; checktime("2017-06-15 14:30:00",30); echo "***************************\n\n"; checktime("2017-06-15 14:35:00",30); echo "***************************\n\n"; checktime("2017-06-15 14:55:00",30); echo "***************************\n\n"; checktime("2017-06-15 16:29:00",30); echo "***************************\n\n"; checktime("2017-06-15 16:30:00",30); echo "***************************\n\n"; checktime("2017-06-15 17:59:00",30); echo "***************************\n\n"; checktime("2017-06-15 18:00:00",30); echo "***************************\n\n"; checktime("2017-06-15 18:29:00",30); echo "***************************\n\n"; checktime("2017-06-15 18:30:00",30); echo "***************************\n\n"; checktime("2017-06-15 19:29:00",30); echo "***************************\n\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MkTp6
function name:  (null)
number of ops:  71
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  202     0  E >   INIT_FCALL                                               'checktime'
          1        SEND_VAL                                                 '2017-06-15+08%3A00%3A00'
          2        SEND_VAL                                                 30
          3        DO_FCALL                                      0          
  203     4        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  205     5        INIT_FCALL                                               'checktime'
          6        SEND_VAL                                                 '2017-06-15+09%3A00%3A00'
          7        SEND_VAL                                                 30
          8        DO_FCALL                                      0          
  206     9        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  208    10        INIT_FCALL                                               'checktime'
         11        SEND_VAL                                                 '2017-06-15+12%3A50%3A00'
         12        SEND_VAL                                                 30
         13        DO_FCALL                                      0          
  209    14        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  211    15        INIT_FCALL                                               'checktime'
         16        SEND_VAL                                                 '2017-06-15+14%3A29%3A00'
         17        SEND_VAL                                                 30
         18        DO_FCALL                                      0          
  212    19        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  214    20        INIT_FCALL                                               'checktime'
         21        SEND_VAL                                                 '2017-06-15+14%3A30%3A00'
         22        SEND_VAL                                                 30
         23        DO_FCALL                                      0          
  215    24        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  217    25        INIT_FCALL                                               'checktime'
         26        SEND_VAL                                                 '2017-06-15+14%3A35%3A00'
         27        SEND_VAL                                                 30
         28        DO_FCALL                                      0          
  218    29        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  220    30        INIT_FCALL                                               'checktime'
         31        SEND_VAL                                                 '2017-06-15+14%3A55%3A00'
         32        SEND_VAL                                                 30
         33        DO_FCALL                                      0          
  221    34        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  223    35        INIT_FCALL                                               'checktime'
         36        SEND_VAL                                                 '2017-06-15+16%3A29%3A00'
         37        SEND_VAL                                                 30
         38        DO_FCALL                                      0          
  224    39        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  227    40        INIT_FCALL                                               'checktime'
         41        SEND_VAL                                                 '2017-06-15+16%3A30%3A00'
         42        SEND_VAL                                                 30
         43        DO_FCALL                                      0          
  228    44        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  230    45        INIT_FCALL                                               'checktime'
         46        SEND_VAL                                                 '2017-06-15+17%3A59%3A00'
         47        SEND_VAL                                                 30
         48        DO_FCALL                                      0          
  231    49        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  234    50        INIT_FCALL                                               'checktime'
         51        SEND_VAL                                                 '2017-06-15+18%3A00%3A00'
         52        SEND_VAL                                                 30
         53        DO_FCALL                                      0          
  235    54        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  237    55        INIT_FCALL                                               'checktime'
         56        SEND_VAL                                                 '2017-06-15+18%3A29%3A00'
         57        SEND_VAL                                                 30
         58        DO_FCALL                                      0          
  238    59        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  240    60        INIT_FCALL                                               'checktime'
         61        SEND_VAL                                                 '2017-06-15+18%3A30%3A00'
         62        SEND_VAL                                                 30
         63        DO_FCALL                                      0          
  241    64        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  243    65        INIT_FCALL                                               'checktime'
         66        SEND_VAL                                                 '2017-06-15+19%3A29%3A00'
         67        SEND_VAL                                                 30
         68        DO_FCALL                                      0          
  244    69        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%0A'
  248    70      > RETURN                                                   1

Function tipohorario:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 46) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
2 jumps found. (Code = 46) Position 1 = 40, Position 2 = 45
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
Branch analysis from position: 32
Branch analysis from position: 19
filename:       /in/MkTp6
function name:  tipoHorario
number of ops:  50
compiled vars:  !0 = $hora, !1 = $inicioMatutino, !2 = $inicioVespertino, !3 = $finMatutino, !4 = $finVespertino, !5 = $horaUTC
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
    4     5        INIT_FCALL                                               'strtotime'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !5, $6
    5     9        INIT_FCALL                                               'strtotime'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $8      
         12        IS_SMALLER_OR_EQUAL                              ~9      $8, !5
         13      > JMPZ_EX                                          ~9      ~9, ->19
         14    >   INIT_FCALL                                               'strtotime'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $10     
         17        IS_SMALLER                                       ~11     !5, $10
         18        BOOL                                             ~9      ~11
         19    > > JMPZ                                                     ~9, ->22
    6    20    > > RETURN                                                   'Matutino'
         21*       JMP                                                      ->49
    8    22    >   INIT_FCALL                                               'strtotime'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $12     
         25        IS_SMALLER_OR_EQUAL                              ~13     $12, !5
         26      > JMPZ_EX                                          ~13     ~13, ->32
         27    >   INIT_FCALL                                               'strtotime'
         28        SEND_VAR                                                 !2
         29        DO_ICALL                                         $14     
         30        IS_SMALLER                                       ~15     !5, $14
         31        BOOL                                             ~13     ~15
         32    > > JMPZ                                                     ~13, ->35
    9    33    > > RETURN                                                   'Descanso+matutino'
         34*       JMP                                                      ->49
   11    35    >   INIT_FCALL                                               'strtotime'
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                         $16     
         38        IS_SMALLER_OR_EQUAL                              ~17     $16, !5
         39      > JMPZ_EX                                          ~17     ~17, ->45
         40    >   INIT_FCALL                                               'strtotime'
         41        SEND_VAR                                                 !4
         42        DO_ICALL                                         $18     
         43        IS_SMALLER                                       ~19     !5, $18
         44        BOOL                                             ~17     ~19
         45    > > JMPZ                                                     ~17, ->48
   12    46    > > RETURN                                                   'Vespertino'
         47*       JMP                                                      ->49
   14    48    > > RETURN                                                   'Descanso+vespertino'
   15    49*     > RETURN                                                   null

End of function tipohorario

Function tipocaso:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 31, Position 2 = 39
Branch analysis from position: 31
2 jumps found. (Code = 47) Position 1 = 40, Position 2 = 49
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 63
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 62
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
Branch analysis from position: 63
2 jumps found. (Code = 46) Position 1 = 71, Position 2 = 79
Branch analysis from position: 71
2 jumps found. (Code = 47) Position 1 = 80, Position 2 = 89
Branch analysis from position: 80
2 jumps found. (Code = 43) Position 1 = 90, Position 2 = 103
Branch analysis from position: 90
2 jumps found. (Code = 43) Position 1 = 100, Position 2 = 102
Branch analysis from position: 100
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 102
Branch analysis from position: 103
2 jumps found. (Code = 43) Position 1 = 112, Position 2 = 113
Branch analysis from position: 112
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 113
2 jumps found. (Code = 43) Position 1 = 122, Position 2 = 123
Branch analysis from position: 122
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 123
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 89
Branch analysis from position: 79
Branch analysis from position: 49
Branch analysis from position: 39
filename:       /in/MkTp6
function name:  tipoCaso
number of ops:  124
compiled vars:  !0 = $hora, !1 = $inicioMatutino, !2 = $inicioVespertino, !3 = $finMatutino, !4 = $finVespertino, !5 = $previoFinMatutino, !6 = $previoFinVespertino, !7 = $cadena
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
   18     5        INIT_FCALL                                               'date'
          6        SEND_VAL                                                 'H%3Ai'
          7        INIT_FCALL                                               'strtotime'
          8        CONCAT                                           ~8      !3, '+-30+minutes'
          9        SEND_VAL                                                 ~8
         10        DO_ICALL                                         $9      
         11        SEND_VAR                                                 $9
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !5, $10
   20    14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'H%3Ai'
         16        INIT_FCALL                                               'strtotime'
         17        CONCAT                                           ~12     !4, '+-30+minutes'
         18        SEND_VAL                                                 ~12
         19        DO_ICALL                                         $13     
         20        SEND_VAR                                                 $13
         21        DO_ICALL                                         $14     
         22        ASSIGN                                                   !6, $14
   24    23        INIT_FCALL                                               'strtotime'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                         $16     
         26        INIT_FCALL                                               'strtotime'
         27        SEND_VAR                                                 !5
         28        DO_ICALL                                         $17     
         29        IS_SMALLER_OR_EQUAL                              ~18     $17, $16
         30      > JMPZ_EX                                          ~18     ~18, ->39
         31    >   INIT_FCALL                                               'strtotime'
         32        SEND_VAR                                                 !0
         33        DO_ICALL                                         $19     
         34        INIT_FCALL                                               'strtotime'
         35        SEND_VAR                                                 !3
         36        DO_ICALL                                         $20     
         37        IS_SMALLER                                       ~21     $19, $20
         38        BOOL                                             ~18     ~21
         39    > > JMPNZ_EX                                         ~18     ~18, ->49
   25    40    >   INIT_FCALL                                               'tipohorario'
         41        SEND_VAR                                                 !0
         42        SEND_VAR                                                 !1
         43        SEND_VAR                                                 !2
         44        SEND_VAR                                                 !3
         45        SEND_VAR                                                 !4
         46        DO_FCALL                                      0  $22     
         47        IS_EQUAL                                         ~23     $22, 'Descanso+matutino'
         48        BOOL                                             ~18     ~23
         49    > > JMPZ                                                     ~18, ->63
   27    50    >   ASSIGN                                                   !7, 'Caso+especial+matutino'
   30    51        INIT_FCALL                                               'tipohorario'
         52        SEND_VAR                                                 !0
         53        SEND_VAR                                                 !1
         54        SEND_VAR                                                 !2
         55        SEND_VAR                                                 !3
         56        SEND_VAR                                                 !4
         57        DO_FCALL                                      0  $25     
         58        IS_EQUAL                                                 $25, 'Descanso+matutino'
         59      > JMPZ                                                     ~26, ->62
   31    60    >   CONCAT                                           ~27     !7, '+en+descanso'
         61        ASSIGN                                                   !7, ~27
   34    62    > > RETURN                                                   !7
   38    63    >   INIT_FCALL                                               'strtotime'
         64        SEND_VAR                                                 !0
         65        DO_ICALL                                         $29     
         66        INIT_FCALL                                               'strtotime'
         67        SEND_VAR                                                 !6
         68        DO_ICALL                                         $30     
         69        IS_SMALLER_OR_EQUAL                              ~31     $30, $29
         70      > JMPZ_EX                                          ~31     ~31, ->79
         71    >   INIT_FCALL                                               'strtotime'
         72        SEND_VAR                                                 !0
         73        DO_ICALL                                         $32     
         74        INIT_FCALL                                               'strtotime'
         75        SEND_VAR                                                 !4
         76        DO_ICALL                                         $33     
         77        IS_SMALLER                                       ~34     $32, $33
         78        BOOL                                             ~31     ~34
         79    > > JMPNZ_EX                                         ~31     ~31, ->89
   39    80    >   INIT_FCALL                                               'tipohorario'
         81        SEND_VAR                                                 !0
         82        SEND_VAR                                                 !1
         83        SEND_VAR                                                 !2
         84        SEND_VAR                                                 !3
         85        SEND_VAR                                                 !4
         86        DO_FCALL                                      0  $35     
         87        IS_EQUAL                                         ~36     $35, 'Descanso+vespertino'
         88        BOOL                                             ~31     ~36
         89    > > JMPZ                                                     ~31, ->103
   41    90    >   ASSIGN                                                   !7, 'Caso+especial+vespertino'
   42    91        INIT_FCALL                                               'tipohorario'
         92        SEND_VAR                                                 !0
         93        SEND_VAR                                                 !1
         94        SEND_VAR                                                 !2
         95        SEND_VAR                                                 !3
         96        SEND_VAR                                                 !4
         97        DO_FCALL                                      0  $38     
         98        IS_EQUAL                                                 $38, 'Descanso+vespertino'
         99      > JMPZ                                                     ~39, ->102
   43   100    >   CONCAT                                           ~40     !7, '+en+descanso'
        101        ASSIGN                                                   !7, ~40
   45   102    > > RETURN                                                   !7
   49   103    >   INIT_FCALL                                               'tipohorario'
        104        SEND_VAR                                                 !0
        105        SEND_VAR                                                 !1
        106        SEND_VAR                                                 !2
        107        SEND_VAR                                                 !3
        108        SEND_VAR                                                 !4
        109        DO_FCALL                                      0  $42     
        110        IS_EQUAL                                                 $42, 'Matutino'
        111      > JMPZ                                                     ~43, ->113
   50   112    > > RETURN                                                   'Caso+normal+matutino'
   53   113    >   INIT_FCALL                                               'tipohorario'
        114        SEND_VAR                                                 !0
        115        SEND_VAR                                                 !1
        116        SEND_VAR                                                 !2
        117        SEND_VAR                                                 !3
        118        SEND_VAR                                                 !4
        119        DO_FCALL                                      0  $44     
        120        IS_EQUAL                                                 $44, 'Vespertino'
        121      > JMPZ                                                     ~45, ->123
   54   122    > > RETURN                                                   'Caso+normal+vespertino'
   56   123    > > RETURN                                                   null

End of function tipocaso

Function restaminutos:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MkTp6
function name:  restaMinutos
number of ops:  28
compiled vars:  !0 = $horaMayor, !1 = $horaMenor, !2 = $resultadoResta
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   60     2        INIT_FCALL                                               'strtotime'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        INIT_FCALL                                               'strtotime'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $4      
          8        SUB                                              ~5      $3, $4
          9        ASSIGN                                                   !2, ~5
   62    10        ROPE_INIT                                     5  ~8      'Resultado+resta+'
         11        ROPE_ADD                                      1  ~8      ~8, !0
         12        ROPE_ADD                                      2  ~8      ~8, '+-+'
         13        ROPE_ADD                                      3  ~8      ~8, !1
         14        ROPE_END                                      4  ~7      ~8, '%3D+'
         15        INIT_FCALL                                               'date'
         16        SEND_VAL                                                 'i'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $11     
         19        CONCAT                                           ~12     ~7, $11
         20        CONCAT                                           ~13     ~12, '%0A'
         21        ECHO                                                     ~13
   64    22        INIT_FCALL                                               'date'
         23        SEND_VAL                                                 'i'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $14     
         26      > RETURN                                                   $14
   66    27*     > RETURN                                                   null

End of function restaminutos

Function minutossobrantes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MkTp6
function name:  minutosSobrantes
number of ops:  35
compiled vars:  !0 = $offset, !1 = $horaMayor, !2 = $horaMenor, !3 = $minMenor, !4 = $minMayor, !5 = $resultadoResta
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   68     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   69     3        INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'H%3Ai'
          5        INIT_FCALL                                               'strtotime'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
          8        SEND_VAR                                                 $6
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !1, $7
   71    11        INIT_FCALL                                               'restaminutos'
         12        SEND_VAR                                                 !1
         13        SEND_VAR                                                 !2
         14        DO_FCALL                                      0  $9      
         15        ASSIGN                                                   !3, $9
   73    16        CONCAT                                           ~11     '00%3A', !0
         17        CONCAT                                           ~12     ~11, ''
         18        ASSIGN                                                   !4, ~12
   74    19        INIT_FCALL                                               'date'
         20        SEND_VAL                                                 'i'
         21        INIT_FCALL                                               'strtotime'
         22        CONCAT                                           ~14     !4, '+-'
         23        CONCAT                                           ~15     ~14, !3
         24        CONCAT                                           ~16     ~15, '+minutes'
         25        SEND_VAL                                                 ~16
         26        DO_ICALL                                         $17     
         27        SEND_VAR                                                 $17
         28        DO_ICALL                                         $18     
         29        ASSIGN                                                   !5, $18
   77    30        CONCAT                                           ~20     'Minutos+sobrantes%3A+', !5
         31        CONCAT                                           ~21     ~20, '%0A'
         32        ECHO                                                     ~21
   79    33      > RETURN                                                   !5
   80    34*     > RETURN                                                   null

End of function minutossobrantes

Function obtenerhoraestimada:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 28
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 111
Branch analysis from position: 111
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 53
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 111
Branch analysis from position: 111
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 70
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 111
Branch analysis from position: 111
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 95
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 111
Branch analysis from position: 111
Branch analysis from position: 95
2 jumps found. (Code = 43) Position 1 = 97, Position 2 = 11

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
282.83 ms | 1434 KiB | 40 Q