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[] = '\x'.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[0] = chr(ord($curr[0]) + 1); if ($curr[0] == 'G') { break; } } } } } $arr[] = '\x'.implode('',$curr); return implode('',$arr); } echo implode(' / ',array_map('arrFromString', array('01-07','08-09','0B-0C','0E-1F','21-2B','2D-39','3B-FF'))); echo "\n\x01\x02\x03\x04\x05\x06\x07 / \x08\x09 / \x0B\x0C / \x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F / \x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B / \x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39 / \x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UrFTj
function name:  (null)
number of ops:  12
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'
   43     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 '+%2F+'
          3        INIT_FCALL                                               'array_map'
          4        SEND_VAL                                                 'arrFromString'
          5        SEND_VAL                                                 <array>
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                         $3      
          9        ECHO                                                     $3
   44    10        ECHO                                                     '%0A%01%02%03%04%05%06%07+%2F+%08%09+%2F+%0B%0C+%2F+%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F+%2F+%21%22%23%24%25%26%27%28%29%2A%2B+%2F+-.%2F0123456789+%2F+%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF'
         11      > RETURN                                                   1

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

End of function arrfromstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.04 ms | 1408 KiB | 27 Q