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

End of function arrfromstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.47 ms | 1407 KiB | 26 Q