3v4l.org

run code in 300+ PHP versions simultaneously
<?php function giveGaps($a,$k) { $cap = 9999; $gap = array(); $count = 0; # Lücken im Array for($i = 0; $i < lengthOf($a); $i++) { for($j = 0; $j ; $j++) { # Lücken: $a[$i] -> Cap $gap[$j] = $a[$i]++; # Lücken 0 -> $a[$i+1] if( ($a[$i]%$cap < $a[$i+1]) ) $gap[$j] = $a[$i]%$cap++; } } foreach($gap as $ptr) { print $ptr; } } giveGaps(array(9998,3),0);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DkPrF
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'givegaps'
          1        SEND_VAL                                                 <array>
          2        SEND_VAL                                                 0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function givegaps:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 7
Branch analysis from position: 32
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 36
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 9
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 7
Branch analysis from position: 32
Branch analysis from position: 7
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 9
Branch analysis from position: 26
Branch analysis from position: 9
Branch analysis from position: 24
filename:       /in/DkPrF
function name:  giveGaps
number of ops:  38
compiled vars:  !0 = $a, !1 = $k, !2 = $cap, !3 = $gap, !4 = $count, !5 = $i, !6 = $j, !7 = $ptr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        ASSIGN                                                   !2, 9999
    4     3        ASSIGN                                                   !3, <array>
    7     4        ASSIGN                                                   !4, 0
    8     5        ASSIGN                                                   !5, 0
          6      > JMP                                                      ->27
   11     7    >   ASSIGN                                                   !6, 0
          8      > JMP                                                      ->25
   13     9    >   FETCH_DIM_RW                                     $14     !0, !5
         10        POST_INC                                         ~15     $14
         11        ASSIGN_DIM                                               !3, !6
         12        OP_DATA                                                  ~15
   16    13        FETCH_DIM_R                                      ~16     !0, !5
         14        MOD                                              ~17     ~16, !2
         15        ADD                                              ~18     !5, 1
         16        FETCH_DIM_R                                      ~19     !0, ~18
         17        IS_SMALLER                                               ~17, ~19
         18      > JMPZ                                                     ~20, ->24
   17    19    >   FETCH_DIM_R                                      ~22     !0, !5
         20        POST_INC                                         ~23     !2
         21        MOD                                              ~24     ~22, ~23
         22        ASSIGN_DIM                                               !3, !6
         23        OP_DATA                                                  ~24
   11    24    >   PRE_INC                                                  !6
         25    > > JMPNZ                                                    !6, ->9
    8    26    >   PRE_INC                                                  !5
         27    >   INIT_FCALL_BY_NAME                                       'lengthOf'
         28        SEND_VAR_EX                                              !0
         29        DO_FCALL                                      0  $27     
         30        IS_SMALLER                                               !5, $27
         31      > JMPNZ                                                    ~28, ->7
   20    32    > > FE_RESET_R                                       $29     !3, ->36
         33    > > FE_FETCH_R                                               $29, !7, ->36
         34    >   ECHO                                                     !7
         35      > JMP                                                      ->33
         36    >   FE_FREE                                                  $29
   21    37      > RETURN                                                   null

End of function givegaps

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.77 ms | 1394 KiB | 14 Q