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 = split($explosion[0]); $upper = split($explosion[1]); $arr = array(); $curr = $lower; while ($curr != $upper) { $arr[] = $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/L36PA
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 = 74
Branch analysis from position: 74
2 jumps found. (Code = 44) Position 1 = 76, Position 2 = 21
Branch analysis from position: 76
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 36
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 35
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 74
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 64
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 63
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 63
Branch analysis from position: 64
2 jumps found. (Code = 44) Position 1 = 76, Position 2 = 21
Branch analysis from position: 76
Branch analysis from position: 21
Branch analysis from position: 74
filename:       /in/L36PA
function name:  arrFromString
number of ops:  78
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_VAR                                                 !0
          3        SEND_VAL                                                 '-'
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    8     6        INIT_FCALL_BY_NAME                                       'split'
          7        CHECK_FUNC_ARG                                           
          8        FETCH_DIM_FUNC_ARG                               $8      !1, 0
          9        SEND_FUNC_ARG                                            $8
         10        DO_FCALL                                      0  $9      
         11        ASSIGN                                                   !2, $9
    9    12        INIT_FCALL_BY_NAME                                       'split'
         13        CHECK_FUNC_ARG                                           
         14        FETCH_DIM_FUNC_ARG                               $11     !1, 1
         15        SEND_FUNC_ARG                                            $11
         16        DO_FCALL                                      0  $12     
         17        ASSIGN                                                   !3, $12
   11    18        ASSIGN                                                   !4, <array>
   12    19        ASSIGN                                                   !5, !2
   13    20      > JMP                                                      ->74
   14    21    >   ASSIGN_DIM                                               !4
         22        OP_DATA                                                  !5
   15    23        INIT_FCALL                                               'is_numeric'
         24        FETCH_DIM_R                                      ~17     !5, 1
         25        SEND_VAL                                                 ~17
         26        DO_ICALL                                         $18     
         27      > JMPZ                                                     $18, ->36
   16    28    >   FETCH_DIM_RW                                     $19     !5, 1
         29        PRE_INC                                                  $19
   17    30        FETCH_DIM_R                                      ~21     !5, 1
         31        IS_SMALLER                                               9, ~21
         32      > JMPZ                                                     ~22, ->35
   18    33    >   ASSIGN_DIM                                               !5, 1
         34        OP_DATA                                                  'A'
         35    > > JMP                                                      ->74
   21    36    >   INIT_FCALL                                               'chr'
         37        INIT_FCALL                                               'ord'
         38        FETCH_DIM_R                                      ~25     !5, 1
         39        SEND_VAL                                                 ~25
         40        DO_ICALL                                         $26     
         41        ADD                                              ~27     $26, 1
         42        SEND_VAL                                                 ~27
         43        DO_ICALL                                         $28     
         44        ASSIGN_DIM                                               !5, 1
         45        OP_DATA                                                  $28
   22    46        FETCH_DIM_R                                      ~29     !5, 1
         47        IS_IDENTICAL                                             ~29, 'E'
         48      > JMPZ                                                     ~30, ->74
   23    49    >   ASSIGN_DIM                                               !5, 1
         50        OP_DATA                                                  0
   25    51        INIT_FCALL                                               'is_numeric'
         52        FETCH_DIM_R                                      ~32     !5, 0
         53        SEND_VAL                                                 ~32
         54        DO_ICALL                                         $33     
         55      > JMPZ                                                     $33, ->64
   26    56    >   FETCH_DIM_RW                                     $34     !5, 0
         57        PRE_INC                                                  $34
   27    58        FETCH_DIM_R                                      ~36     !5, 0
         59        IS_SMALLER                                               9, ~36
         60      > JMPZ                                                     ~37, ->63
   28    61    >   ASSIGN_DIM                                               !5, 0
         62        OP_DATA                                                  'A'
         63    > > JMP                                                      ->74
   31    64    >   INIT_FCALL                                               'chr'
         65        INIT_FCALL                                               'ord'
         66        FETCH_DIM_R                                      ~40     !5, 1
         67        SEND_VAL                                                 ~40
         68        DO_ICALL                                         $41     
         69        ADD                                              ~42     $41, 1
         70        SEND_VAL                                                 ~42
         71        DO_ICALL                                         $43     
         72        ASSIGN_DIM                                               !5, 1
         73        OP_DATA                                                  $43
   13    74    >   IS_NOT_EQUAL                                             !5, !3
         75      > JMPNZ                                                    ~44, ->21
   36    76    > > RETURN                                                   !4
   37    77*     > RETURN                                                   null

End of function arrfromstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.45 ms | 1407 KiB | 24 Q