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 (implode('',$curr) != implode('',$upper)) { $arr[] = chr(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] === 'G') { $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); } } } } $arr[] = implode('',$curr); return $arr; } print_r(arrFromString('0E-1F'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8GDae
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'
   40     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'arrfromstring'
          3        SEND_VAL                                                 '0E-1F'
          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 = 79
Branch analysis from position: 79
2 jumps found. (Code = 44) Position 1 = 89, Position 2 = 19
Branch analysis from position: 89
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 41
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 40
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
Branch analysis from position: 40
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 79
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 69
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 68
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
Branch analysis from position: 68
Branch analysis from position: 69
2 jumps found. (Code = 44) Position 1 = 89, Position 2 = 19
Branch analysis from position: 89
Branch analysis from position: 19
Branch analysis from position: 79
filename:       /in/8GDae
function name:  arrFromString
number of ops:  97
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                                                      ->79
   14    19    >   INIT_FCALL                                               'chr'
         20        INIT_FCALL                                               'implode'
         21        SEND_VAL                                                 ''
         22        SEND_VAR                                                 !5
         23        DO_ICALL                                         $17     
         24        SEND_VAR                                                 $17
         25        DO_ICALL                                         $18     
         26        ASSIGN_DIM                                               !4
         27        OP_DATA                                                  $18
   15    28        INIT_FCALL                                               'is_numeric'
         29        FETCH_DIM_R                                      ~19     !5, 1
         30        SEND_VAL                                                 ~19
         31        DO_ICALL                                         $20     
         32      > JMPZ                                                     $20, ->41
   16    33    >   FETCH_DIM_RW                                     $21     !5, 1
         34        PRE_INC                                                  $21
   17    35        FETCH_DIM_R                                      ~23     !5, 1
         36        IS_SMALLER                                               9, ~23
         37      > JMPZ                                                     ~24, ->40
   18    38    >   ASSIGN_DIM                                               !5, 1
         39        OP_DATA                                                  'A'
         40    > > JMP                                                      ->79
   21    41    >   INIT_FCALL                                               'chr'
         42        INIT_FCALL                                               'ord'
         43        FETCH_DIM_R                                      ~27     !5, 1
         44        SEND_VAL                                                 ~27
         45        DO_ICALL                                         $28     
         46        ADD                                              ~29     $28, 1
         47        SEND_VAL                                                 ~29
         48        DO_ICALL                                         $30     
         49        ASSIGN_DIM                                               !5, 1
         50        OP_DATA                                                  $30
   22    51        FETCH_DIM_R                                      ~31     !5, 1
         52        IS_IDENTICAL                                             ~31, 'G'
         53      > JMPZ                                                     ~32, ->79
   23    54    >   ASSIGN_DIM                                               !5, 1
         55        OP_DATA                                                  0
   25    56        INIT_FCALL                                               'is_numeric'
         57        FETCH_DIM_R                                      ~34     !5, 0
         58        SEND_VAL                                                 ~34
         59        DO_ICALL                                         $35     
         60      > JMPZ                                                     $35, ->69
   26    61    >   FETCH_DIM_RW                                     $36     !5, 0
         62        PRE_INC                                                  $36
   27    63        FETCH_DIM_R                                      ~38     !5, 0
         64        IS_SMALLER                                               9, ~38
         65      > JMPZ                                                     ~39, ->68
   28    66    >   ASSIGN_DIM                                               !5, 0
         67        OP_DATA                                                  'A'
         68    > > JMP                                                      ->79
   31    69    >   INIT_FCALL                                               'chr'
         70        INIT_FCALL                                               'ord'
         71        FETCH_DIM_R                                      ~42     !5, 1
         72        SEND_VAL                                                 ~42
         73        DO_ICALL                                         $43     
         74        ADD                                              ~44     $43, 1
         75        SEND_VAL                                                 ~44
         76        DO_ICALL                                         $45     
         77        ASSIGN_DIM                                               !5, 1
         78        OP_DATA                                                  $45
   13    79    >   INIT_FCALL                                               'implode'
         80        SEND_VAL                                                 ''
         81        SEND_VAR                                                 !5
         82        DO_ICALL                                         $46     
         83        INIT_FCALL                                               'implode'
         84        SEND_VAL                                                 ''
         85        SEND_VAR                                                 !3
         86        DO_ICALL                                         $47     
         87        IS_NOT_EQUAL                                             $46, $47
         88      > JMPNZ                                                    ~48, ->19
   36    89    >   INIT_FCALL                                               'implode'
         90        SEND_VAL                                                 ''
         91        SEND_VAR                                                 !5
         92        DO_ICALL                                         $50     
         93        ASSIGN_DIM                                               !4
         94        OP_DATA                                                  $50
   37    95      > RETURN                                                   !4
   38    96*     > RETURN                                                   null

End of function arrfromstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.08 ms | 1407 KiB | 28 Q