3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = get_minutes('02:50'); $b = get_minutes('08:30'); /*echo intval(($b+30)/60); echo " "; echo ($b+30)%60;*/ $d = $b-$a; $intervalo = 15; $citas = intval($d/$intervalo); for($i=0;$i<$citas;$i++){ $horaCom = intval($a/60); $horaTer = intval(($a+$intervalo)/60); $minCom = $a%60; $minTer = ($a+$intervalo)%60; echo $horaCom.":".$minCom."-".$horaTer.":".$minTer."\n"; $a=$a+$intervalo; } function get_minutes($time_string) { $parts = explode(":", $time_string); $hours = intval($parts[0]); $minutes = intval($parts[1]); return $hours * 60 + $minutes; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 16
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 16
Branch analysis from position: 41
Branch analysis from position: 16
filename:       /in/LKCtA
function name:  (null)
number of ops:  42
compiled vars:  !0 = $a, !1 = $b, !2 = $d, !3 = $intervalo, !4 = $citas, !5 = $i, !6 = $horaCom, !7 = $horaTer, !8 = $minCom, !9 = $minTer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'get_minutes'
          1        SEND_VAL_EX                                              '02%3A50'
          2        DO_FCALL                                      0  $10     
          3        ASSIGN                                                   !0, $10
    3     4        INIT_FCALL_BY_NAME                                       'get_minutes'
          5        SEND_VAL_EX                                              '08%3A30'
          6        DO_FCALL                                      0  $12     
          7        ASSIGN                                                   !1, $12
    8     8        SUB                                              ~14     !1, !0
          9        ASSIGN                                                   !2, ~14
    9    10        ASSIGN                                                   !3, 15
   10    11        DIV                                              ~17     !2, !3
         12        CAST                                          4  ~18     ~17
         13        ASSIGN                                                   !4, ~18
   12    14        ASSIGN                                                   !5, 0
         15      > JMP                                                      ->39
   13    16    >   DIV                                              ~21     !0, 60
         17        CAST                                          4  ~22     ~21
         18        ASSIGN                                                   !6, ~22
   14    19        ADD                                              ~24     !0, !3
         20        DIV                                              ~25     ~24, 60
         21        CAST                                          4  ~26     ~25
         22        ASSIGN                                                   !7, ~26
   15    23        MOD                                              ~28     !0, 60
         24        ASSIGN                                                   !8, ~28
   16    25        ADD                                              ~30     !0, !3
         26        MOD                                              ~31     ~30, 60
         27        ASSIGN                                                   !9, ~31
   17    28        CONCAT                                           ~33     !6, '%3A'
         29        CONCAT                                           ~34     ~33, !8
         30        CONCAT                                           ~35     ~34, '-'
         31        CONCAT                                           ~36     ~35, !7
         32        CONCAT                                           ~37     ~36, '%3A'
         33        CONCAT                                           ~38     ~37, !9
         34        CONCAT                                           ~39     ~38, '%0A'
         35        ECHO                                                     ~39
   18    36        ADD                                              ~40     !0, !3
         37        ASSIGN                                                   !0, ~40
   12    38        PRE_INC                                                  !5
         39    >   IS_SMALLER                                               !5, !4
         40      > JMPNZ                                                    ~43, ->16
   29    41    > > RETURN                                                   1

Function get_minutes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LKCtA
function name:  get_minutes
number of ops:  16
compiled vars:  !0 = $time_string, !1 = $parts, !2 = $hours, !3 = $minutes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   23     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%3A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   25     6        FETCH_DIM_R                                      ~6      !1, 0
          7        CAST                                          4  ~7      ~6
          8        ASSIGN                                                   !2, ~7
   26     9        FETCH_DIM_R                                      ~9      !1, 1
         10        CAST                                          4  ~10     ~9
         11        ASSIGN                                                   !3, ~10
   28    12        MUL                                              ~12     !2, 60
         13        ADD                                              ~13     ~12, !3
         14      > RETURN                                                   ~13
   29    15*     > RETURN                                                   null

End of function get_minutes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.58 ms | 1405 KiB | 15 Q