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

End of function arrfromstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.04 ms | 1406 KiB | 30 Q