3v4l.org

run code in 300+ PHP versions simultaneously
<?php $chanstring = "\x01-07 / %x08-09 / %x0B-0C / %x0E-1F / %x21-2B / %x2D-39 / %x3B-FF"; function arrFromString($string) { $explosion = explode('-',$string); $lower = str_split($explosion[0]); $upper = str_split($explosion[1]); $arr = array(); $curr = $lower; while ($curr != $upper) { $arr[] = implode('',$curr); if (is_numeric($curr[1])) { $curr[1]++; if ($curr[1] > 9) { $curr[1] = 'A'; } } else { $curr[1] = chr(ord($curr[1]) + 1); if ($curr[1] === 'E') { $curr[1] = 0; if (is_numeric($curr[0])) { $curr[0]++; if ($curr[0] > 9) { $curr[0] = 'A'; } } else { $curr[1] = chr(ord($curr[1]) + 1); } } } } return $arr; } print_r(arrFromString('01-07'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9tCLB
function name:  (null)
number of ops:  8
compiled vars:  !0 = $chanstring
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%01-07+%2F+%25x08-09+%2F+%25x0B-0C+%2F+%25x0E-1F+%2F+%25x21-2B+%2F+%25x2D-39+%2F+%25x3B-FF'
   39     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'arrfromstring'
          3        SEND_VAL                                                 '01-07'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function arrfromstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
2 jumps found. (Code = 44) Position 1 = 78, Position 2 = 19
Branch analysis from position: 78
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 38
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 37
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 76
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 66
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 65
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 65
Branch analysis from position: 66
2 jumps found. (Code = 44) Position 1 = 78, Position 2 = 19
Branch analysis from position: 78
Branch analysis from position: 19
Branch analysis from position: 76
filename:       /in/9tCLB
function name:  arrFromString
number of ops:  80
compiled vars:  !0 = $string, !1 = $explosion, !2 = $lower, !3 = $upper, !4 = $arr, !5 = $curr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '-'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    8     6        INIT_FCALL                                               'str_split'
          7        FETCH_DIM_R                                      ~8      !1, 0
          8        SEND_VAL                                                 ~8
          9        DO_ICALL                                         $9      
         10        ASSIGN                                                   !2, $9
    9    11        INIT_FCALL                                               'str_split'
         12        FETCH_DIM_R                                      ~11     !1, 1
         13        SEND_VAL                                                 ~11
         14        DO_ICALL                                         $12     
         15        ASSIGN                                                   !3, $12
   11    16        ASSIGN                                                   !4, <array>
   12    17        ASSIGN                                                   !5, !2
   13    18      > JMP                                                      ->76
   14    19    >   INIT_FCALL                                               'implode'
         20        SEND_VAL                                                 ''
         21        SEND_VAR                                                 !5
         22        DO_ICALL                                         $17     
         23        ASSIGN_DIM                                               !4
         24        OP_DATA                                                  $17
   15    25        INIT_FCALL                                               'is_numeric'
         26        FETCH_DIM_R                                      ~18     !5, 1
         27        SEND_VAL                                                 ~18
         28        DO_ICALL                                         $19     
         29      > JMPZ                                                     $19, ->38
   16    30    >   FETCH_DIM_RW                                     $20     !5, 1
         31        PRE_INC                                                  $20
   17    32        FETCH_DIM_R                                      ~22     !5, 1
         33        IS_SMALLER                                               9, ~22
         34      > JMPZ                                                     ~23, ->37
   18    35    >   ASSIGN_DIM                                               !5, 1
         36        OP_DATA                                                  'A'
         37    > > JMP                                                      ->76
   21    38    >   INIT_FCALL                                               'chr'
         39        INIT_FCALL                                               'ord'
         40        FETCH_DIM_R                                      ~26     !5, 1
         41        SEND_VAL                                                 ~26
         42        DO_ICALL                                         $27     
         43        ADD                                              ~28     $27, 1
         44        SEND_VAL                                                 ~28
         45        DO_ICALL                                         $29     
         46        ASSIGN_DIM                                               !5, 1
         47        OP_DATA                                                  $29
   22    48        FETCH_DIM_R                                      ~30     !5, 1
         49        IS_IDENTICAL                                             ~30, 'E'
         50      > JMPZ                                                     ~31, ->76
   23    51    >   ASSIGN_DIM                                               !5, 1
         52        OP_DATA                                                  0
   25    53        INIT_FCALL                                               'is_numeric'
         54        FETCH_DIM_R                                      ~33     !5, 0
         55        SEND_VAL                                                 ~33
         56        DO_ICALL                                         $34     
         57      > JMPZ                                                     $34, ->66
   26    58    >   FETCH_DIM_RW                                     $35     !5, 0
         59        PRE_INC                                                  $35
   27    60        FETCH_DIM_R                                      ~37     !5, 0
         61        IS_SMALLER                                               9, ~37
         62      > JMPZ                                                     ~38, ->65
   28    63    >   ASSIGN_DIM                                               !5, 0
         64        OP_DATA                                                  'A'
         65    > > JMP                                                      ->76
   31    66    >   INIT_FCALL                                               'chr'
         67        INIT_FCALL                                               'ord'
         68        FETCH_DIM_R                                      ~41     !5, 1
         69        SEND_VAL                                                 ~41
         70        DO_ICALL                                         $42     
         71        ADD                                              ~43     $42, 1
         72        SEND_VAL                                                 ~43
         73        DO_ICALL                                         $44     
         74        ASSIGN_DIM                                               !5, 1
         75        OP_DATA                                                  $44
   13    76    >   IS_NOT_EQUAL                                             !5, !3
         77      > JMPNZ                                                    ~45, ->19
   36    78    > > RETURN                                                   !4
   37    79*     > RETURN                                                   null

End of function arrfromstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.83 ms | 1406 KiB | 28 Q