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 minutosDiferencia($horaMayor, $horaMenor){ $resultadoResta = strtotime($horaMayor) - strtotime($horaMenor); echo "Resultado resta ". date("H:i", $resultadoResta)."\n"; } function agregarOffsetHora($hora, $tipoCaso, $inicioMatutino, $inicioVespertino, $finMatutino, $finVespertino, $offset){ //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 ".$offset." a ".$hora."\n"; echo "Hora estimada: " . date('H:i', strtotime($hora . " +30 minutes") ) . "\n"; } //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"; minutosDiferencia($finMatutino, $hora); } //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"; } //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"; minutosDiferencia($finVespertino, $hora); } //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"; } } } 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); agregarOffsetHora($horaMinuto, $tipoCaso, $horaInicioMatutino, $horaInicioVespertino, $horaFinMatutino, $horaFinVespertino, $minutosTolerancia ); echo "\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 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/pBIuj
function name:  (null)
number of ops:  61
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  140     0  E >   INIT_FCALL                                               'checktime'
          1        SEND_VAL                                                 '2017-06-15+08%3A00%3A00'
          2        SEND_VAL                                                 30
          3        DO_FCALL                                      0          
  141     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'
  143     5        INIT_FCALL                                               'checktime'
          6        SEND_VAL                                                 '2017-06-15+09%3A00%3A00'
          7        SEND_VAL                                                 30
          8        DO_FCALL                                      0          
  144     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'
  146    10        INIT_FCALL                                               'checktime'
         11        SEND_VAL                                                 '2017-06-15+12%3A50%3A00'
         12        SEND_VAL                                                 30
         13        DO_FCALL                                      0          
  147    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'
  149    15        INIT_FCALL                                               'checktime'
         16        SEND_VAL                                                 '2017-06-15+14%3A29%3A00'
         17        SEND_VAL                                                 30
         18        DO_FCALL                                      0          
  150    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'
  152    20        INIT_FCALL                                               'checktime'
         21        SEND_VAL                                                 '2017-06-15+14%3A30%3A00'
         22        SEND_VAL                                                 30
         23        DO_FCALL                                      0          
  153    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'
  155    25        INIT_FCALL                                               'checktime'
         26        SEND_VAL                                                 '2017-06-15+16%3A29%3A00'
         27        SEND_VAL                                                 30
         28        DO_FCALL                                      0          
  156    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'
  159    30        INIT_FCALL                                               'checktime'
         31        SEND_VAL                                                 '2017-06-15+16%3A30%3A00'
         32        SEND_VAL                                                 30
         33        DO_FCALL                                      0          
  160    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'
  162    35        INIT_FCALL                                               'checktime'
         36        SEND_VAL                                                 '2017-06-15+17%3A59%3A00'
         37        SEND_VAL                                                 30
         38        DO_FCALL                                      0          
  163    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'
  166    40        INIT_FCALL                                               'checktime'
         41        SEND_VAL                                                 '2017-06-15+18%3A00%3A00'
         42        SEND_VAL                                                 30
         43        DO_FCALL                                      0          
  167    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'
  169    45        INIT_FCALL                                               'checktime'
         46        SEND_VAL                                                 '2017-06-15+18%3A29%3A00'
         47        SEND_VAL                                                 30
         48        DO_FCALL                                      0          
  170    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'
  172    50        INIT_FCALL                                               'checktime'
         51        SEND_VAL                                                 '2017-06-15+18%3A30%3A00'
         52        SEND_VAL                                                 30
         53        DO_FCALL                                      0          
  173    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'
  175    55        INIT_FCALL                                               'checktime'
         56        SEND_VAL                                                 '2017-06-15+19%3A29%3A00'
         57        SEND_VAL                                                 30
         58        DO_FCALL                                      0          
  176    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'
  180    60      > 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/pBIuj
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/pBIuj
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 minutosdiferencia:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pBIuj
function name:  minutosDiferencia
number of ops:  18
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        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'H%3Ai'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $7      
         14        CONCAT                                           ~8      'Resultado+resta+', $7
         15        CONCAT                                           ~9      ~8, '%0A'
         16        ECHO                                                     ~9
   64    17      > RETURN                                                   null

End of function minutosdiferencia

Function agregaroffsethora:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 29
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 90
Branch analysis from position: 90
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 41
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 90
Branch analysis from position: 90
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 60
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 90
Branch analysis from position: 90
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 72
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 90
Branch analysis from position: 90
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 90
Branch analysis from position: 74
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 90
Branch analysis from position: 11
filename:       /in/pBIuj
function name:  agregarOffsetHora
number of ops:  91
compiled vars:  !0 = $hora, !1 = $tipoCaso, !2 = $inicioMatutino, !3 = $inicioVespertino, !4 = $finMatutino, !5 = $finVespertino, !6 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   66     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
          5        RECV                                             !5      
          6        RECV                                             !6      
   69     7        IS_EQUAL                                         ~7      !1, 'Caso+normal+matutino'
          8      > JMPNZ_EX                                         ~7      ~7, ->11
          9    >   IS_EQUAL                                         ~8      !1, 'Caso+normal+vespertino'
         10        BOOL                                             ~7      ~8
         11    > > JMPZ                                                     ~7, ->29
   70    12    >   CONCAT                                           ~9      'Se+le+sumar%C3%A1+el+offset+', !6
         13        CONCAT                                           ~10     ~9, '+a+'
         14        CONCAT                                           ~11     ~10, !0
         15        CONCAT                                           ~12     ~11, '%0A'
         16        ECHO                                                     ~12
   72    17        INIT_FCALL                                               'date'
         18        SEND_VAL                                                 'H%3Ai'
         19        INIT_FCALL                                               'strtotime'
         20        CONCAT                                           ~13     !0, '+%2B30+minutes'
         21        SEND_VAL                                                 ~13
         22        DO_ICALL                                         $14     
         23        SEND_VAR                                                 $14
         24        DO_ICALL                                         $15     
         25        CONCAT                                           ~16     'Hora+estimada%3A+', $15
         26        CONCAT                                           ~17     ~16, '%0A'
         27        ECHO                                                     ~17
         28      > JMP                                                      ->90
   80    29    >   IS_EQUAL                                                 !1, 'Caso+especial+matutino'
         30      > JMPZ                                                     ~18, ->41
   81    31    >   CONCAT                                           ~19     'Se+le+sumar%C3%A1+el+sobrante+de+', !6
         32        CONCAT                                           ~20     ~19, '+a+la+horaInicioVespertino%3A+'
         33        CONCAT                                           ~21     ~20, !3
         34        CONCAT                                           ~22     ~21, '%0A'
         35        ECHO                                                     ~22
   82    36        INIT_FCALL                                               'minutosdiferencia'
         37        SEND_VAR                                                 !4
         38        SEND_VAR                                                 !0
         39        DO_FCALL                                      0          
         40      > JMP                                                      ->90
   87    41    >   IS_EQUAL                                                 !1, 'Caso+especial+matutino+en+descanso'
         42      > JMPZ                                                     ~24, ->60
   88    43    >   CONCAT                                           ~25     'Se+le+sumar%C3%A1+el+offset+entero+', !6
         44        CONCAT                                           ~26     ~25, '+a+la+horaInicioVespertino%3A+'
         45        CONCAT                                           ~27     ~26, !3
         46        CONCAT                                           ~28     ~27, '%0A'
         47        ECHO                                                     ~28
   90    48        INIT_FCALL                                               'date'
         49        SEND_VAL                                                 'H%3Ai'
         50        INIT_FCALL                                               'strtotime'
         51        CONCAT                                           ~29     !3, '+%2B30+minutes'
         52        SEND_VAL                                                 ~29
         53        DO_ICALL                      

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.39 ms | 1431 KiB | 36 Q