3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Punycode { const BASE = 36; const T_MIN = 1; const T_MAX = 26; const SKEW = 38; const DAMP = 700; const INITIAL_BIAS = 72; const INITIAL_N = 128; private function decodeUtf8Character($input, $i, &$codePoint = null) { $input = array_values(unpack('C*', substr($input, $i, 4))); $count = count($input); switch (true) { case $count >= 2 && ($input[0] & 0xE0) === 0xC0 && ($input[1] & 0xC0) === 0x80: $codePoint = (($input[0] & 0x1F) << 6) | ($input[1] & 0x3F); return 2; case $count >= 3 && ($input[0] & 0xF0) === 0xE0 && (($input[1] ^ 0x40) & ($input[2] ^ 0x40) & 0xC0) === 0xC0: $codePoint = (($input[0] & 0x0F) << 12) | (($input[1] & 0x3F) << 6) | ($input[2] & 0x3F); return 3; case $count >= 4 && ($input[0] & 0xF8) === 0xF0 && (($input[1] ^ 0x40) & ($input[2] ^ 0x40) & ($input[3] ^ 0x40) & 0xC0) === 0xC0: $codePoint = (($input[0] & 0x07) << 18) | (($input[1] & 0x3F) << 12) | (($input[2] & 0x3F) << 6) | ($input[3] & 0x3F); return 4; } return 0; } private function encodeUtf8CodePoint($codePoint) { switch (true) { case $codePoint < 0x80: return pack('C*', $codePoint & 0x7F); case $codePoint < 0x0800: return pack('C*', (($codePoint & 0x07C0) >> 6) | 0xC0, ($codePoint & 0x3F) | 0x80); case $codePoint < 0x010000: return pack('C*', (($codePoint & 0xF000) >> 12) | 0xE0, (($codePoint & 0x0FC0) >> 6) | 0x80, ($codePoint & 0x3F) | 0x80); case $codePoint < 0x110000: return pack('C*', (($codePoint & 0x1C0000) >> 18) | 0xF0, (($codePoint & 0x03F000) >> 12) | 0x80, (($codePoint & 0x0FC0) >> 6) | 0x80, ($codePoint & 0x3F) | 0x80); } return false; } private function isDnsLabelChar($charCode) { return ($charCode >= 0x61 && $charCode <= 0x7A) // lower-case letter || ($charCode >= 0x30 && $charCode <= 0x39) // digit || $charCode === 0x2D // - || ($charCode >= 0x41 && $charCode <= 0x5A); // upper-case letter; } private function isPrintableLatin1Char($charCode) { return $charCode >= 0xA0; } private function getEncodingParts($input, &$output = [], &$nonBasicChars = []) { $isUtf8 = true; for ($i = $p = 0, $l = strlen($input); $i < $l; $p++) { $charCode = ord($input[$i]); if ($charCode & 0x80) { if ($isUtf8) { if ($len = $this->decodeUtf8Character($input, $i, $codePoint)) { $nonBasicChars[] = [$p, $codePoint, substr($input, $i, $len), $len]; // undecoded data is stored for UTF-8 chars to facilitate conversion to latin1 if necessary $i += $len; } else { // not a valid UTF-8 code point, convert $nonBasicChars to latin1 representation if (!$this->isPrintableLatin1Char($charCode)) { return false; } $isUtf8 = false; if (!empty($nonBasicChars)) { $offset = 0; for ($j = 0, $l = count($nonBasicChars); $j < $l; $j++) { $base = $nonBasicChars[$j][0]; $nonBasicChars[$j][0] += $offset; $nonBasicChars[$j][1] = ord($nonBasicChars[$j][2][0]); for ($k = 1; $k < $nonBasicChars[$j][3]; $k++) { $nonBasicChars[] = [$base + ++$offset, ord($nonBasicChars[$j][2][$k])]; } } $nonBasicChars[] = [$i++, $charCode]; usort($nonBasicChars, function($a, $b) { return $a[0] - $b[0]; }); } else { $nonBasicChars[] = [$i++, $charCode]; } } } else if ($this->isPrintableLatin1Char($charCode)) { $nonBasicChars[] = [$i++, $charCode]; } else { return false; } } else if ($this->isDnsLabelChar($charCode)) { $output[] = $input[$i++]; } else { return false; } } return true; } private function adaptBias($delta, $numPoints, $first) { $delta = $first ? $delta / self::DAMP : $delta / 2; $delta += $delta / $numPoints; $div = self::BASE - self::T_MIN; $end = ($div * self::T_MAX) / 2; for ($k = 0; $delta > $end; $k += self::BASE) { $delta = (int)($delta / $div); } return $k + (($div + 1) * $delta) / ($delta + self::SKEW); } private function decodeDigit($digits, $index) { if (isset($digits[$index])) { $codePoint = ord($digits[$index]); if ($codePoint >= 0x61 && $codePoint <= 0x7A) { return $codePoint - 97; } else if ($digit >= 0x30 && $digit <= 0x39) { return $codePoint - 22; } } return false; } private function decodeLabel($input) { if (substr($input, 0, 4) !== 'xn--') { return $input; } $input = substr($input, 4); if (false !== $nonBasicCharsStart = strrpos($input, '-')) { $output = str_split(substr($input, 0, $nonBasicCharsStart), 1); $nonBasicChars = substr($input, $nonBasicCharsStart + 1); } else { $output = []; $nonBasicChars = $input; } $n = self::INITIAL_N; $i = 0; $bias = self::INITIAL_BIAS; for ($j = 0, $l = strlen($nonBasicChars); $j < $l; $i++) { $oldi = $i; $w = 1; for ($k = self::BASE;; $k+= self::BASE) { if (false === $digit = $this->decodeDigit($nonBasicChars, $j++)) { return false; } $i += $digit * $w; if ($k <= $bias) { $t = self::T_MIN; } else if ($k >= $bias + self::T_MAX) { $t = self::T_MAX; } else { $t = $k - $bias; } if ($digit < $t) { break; } $w *= (int) (self::BASE - $t); } $c = count($output) + 1; $bias = $this->adaptBias($i - $oldi, $c, $oldi === 0); $n += (int)($i / $c); $i %= $c; array_splice($output, $i, 0, [$this->encodeUtf8CodePoint($n)]); } return implode('', $output); } private function encodeLabel($input) { if (!$this->getEncodingParts($input, $output, $nonBasicChars)) { return false; } if (empty($nonBasicChars)) { return $input; } $output = 'xn--' . $output; } public function decode($input) { $output = []; foreach (explode('.', strtolower($input)) as $label) { if (false === $label = $this->decodeLabel($label)) { return false; } $output[] = $label; } return implode('.', $output); } public function encode($input) { $output = []; foreach (explode('.', strtolower($input)) as $label) { if (false === $label = $this->encodeLabel($label)) { return false; } $output[] = $label; } return implode('.', $output); } } echo (new Punycode)->decode("xn---with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecDhJ
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  254     0  E >   NEW                                              $0      'Punycode'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'decode'
          3        SEND_VAL_EX                                              'xn---with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FecDhJ%3A102%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecDhJ
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  102     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  103     2        FETCH_DIM_R                                      ~2      !0, 0
          3        FETCH_DIM_R                                      ~3      !1, 0
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
  104     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FecDhJ%3A102%240

Class Punycode:
Function decodeutf8character:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 66
Branch analysis from position: 30
2 jumps found. (Code = 46) Position 1 = 32, Position 2 = 36
Branch analysis from position: 32
2 jumps found. (Code = 46) Position 1 = 37, Position 2 = 45
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 74
Branch analysis from position: 46
2 jumps found. (Code = 46) Position 1 = 48, Position 2 = 52
Branch analysis from position: 48
2 jumps found. (Code = 46) Position 1 = 53, Position 2 = 64
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 86
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 102
Branch analysis from position: 102
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 86
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
Branch analysis from position: 52
Branch analysis from position: 74
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
Branch analysis from position: 36
Branch analysis from position: 66
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 24
filename:       /in/ecDhJ
function name:  decodeUtf8Character
number of ops:  104
compiled vars:  !0 = $input, !1 = $i, !2 = $codePoint, !3 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
   15     3        INIT_FCALL                                               'array_values'
          4        INIT_FCALL                                               'unpack'
          5        SEND_VAL                                                 'C%2A'
          6        INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 4
         10        DO_ICALL                                         $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
         14        DO_ICALL                                         $6      
         15        ASSIGN                                                   !0, $6
   16    16        COUNT                                            ~8      !0
         17        ASSIGN                                                   !3, ~8
   19    18        IS_SMALLER_OR_EQUAL                              ~11     2, !3
         19      > JMPZ_EX                                          ~11     ~11, ->24
         20    >   FETCH_DIM_R                                      ~12     !0, 0
         21        BW_AND                                           ~13     ~12, 224
         22        IS_IDENTICAL                                     ~14     ~13, 192
         23        BOOL                                             ~11     ~14
         24    > > JMPZ_EX                                          ~11     ~11, ->29
         25    >   FETCH_DIM_R                                      ~15     !0, 1
         26        BW_AND                                           ~16     ~15, 192
         27        IS_IDENTICAL                                     ~17     ~16, 128
         28        BOOL                                             ~11     ~17
         29    > > JMPNZ                                                    ~11, ->66
   23    30    >   IS_SMALLER_OR_EQUAL                              ~18     3, !3
         31      > JMPZ_EX                                          ~18     ~18, ->36
         32    >   FETCH_DIM_R                                      ~19     !0, 0
         33        BW_AND                                           ~20     ~19, 240
         34        IS_IDENTICAL                                     ~21     ~20, 224
         35        BOOL                                             ~18     ~21
         36    > > JMPZ_EX                                          ~18     ~18, ->45
         37    >   FETCH_DIM_R                                      ~22     !0, 1
         38        BW_XOR                                           ~23     ~22, 64
         39        FETCH_DIM_R                                      ~24     !0, 2
         40        BW_XOR                                           ~25     ~24, 64
         41        BW_AND                                           ~26     ~23, ~25
         42        BW_AND                                           ~27     ~26, 192
         43        IS_IDENTICAL                                     ~28     ~27, 192
         44        BOOL                                             ~18     ~28
         45    > > JMPNZ                                                    ~18, ->74
   27    46    >   IS_SMALLER_OR_EQUAL                              ~29     4, !3
         47      > JMPZ_EX                                          ~29     ~29, ->52
         48    >   FETCH_DIM_R                                      ~30     !0, 0
         49        BW_AND                                           ~31     ~30, 248
         50        IS_IDENTICAL                                     ~32     ~31, 240
         51        BOOL                                             ~29     ~32
         52    > > JMPZ_EX                                          ~29     ~29, ->64
         53    >   FETCH_DIM_R                                      ~33     !0, 1
         54        BW_XOR                                           ~34     ~33, 64
         55        FETCH_DIM_R                                      ~35     !0, 2
         56        BW_XOR                                           ~36     ~35, 64
         57        BW_AND                                           ~37     ~34, ~36
         58        FETCH_DIM_R                                      ~38     !0, 3
         59        BW_XOR                                           ~39     ~38, 64
         60        BW_AND                                           ~40     ~37, ~39
         61        BW_AND                                           ~41     ~40, 192
         62        IS_IDENTICAL                                     ~42     ~41, 192
         63        BOOL                                             ~29     ~42
         64    > > JMPNZ                                                    ~29, ->86
         65    > > JMP                                                      ->102
   20    66    >   FETCH_DIM_R                                      ~43     !0, 0
         67        BW_AND                                           ~44     ~43, 31
         68        SL                                               ~45     ~44, 6
         69        FETCH_DIM_R                                      ~46     !0, 1
         70        BW_AND                                           ~47     ~46, 63
         71        BW_OR                                            ~48     ~45, ~47
         72        ASSIGN                                                   !2, ~48
   21    73      > RETURN                                                   2
   24    74    >   FETCH_DIM_R                                      ~50     !0, 0
         75        BW_AND                                           ~51     ~50, 15
         76        SL                                               ~52     ~51, 12
         77        FETCH_DIM_R                                      ~53     !0, 1
         78        BW_AND                                           ~54     ~53, 63
         79        SL                                               ~55     ~54, 6
         80        BW_OR                                            ~56     ~52, ~55
         81        FETCH_DIM_R                                      ~57     !0, 2
         82        BW_AND                                           ~58     ~57, 63
         83        BW_OR                                            ~59     ~56, ~58
         84        ASSIGN                                                   !2, ~59
   25    85      > RETURN                                                   3
   28    86    >   FETCH_DIM_R                                      ~61     !0, 0
         87        BW_AND                                           ~62     ~61, 7
         88        SL                                               ~63     ~62, 18
         89        FETCH_DIM_R                                      ~64     !0, 1
         90        BW_AND                                           ~65     ~64, 63
         91        SL                                               ~66     ~65, 12
         92        BW_OR                                            ~67     ~63, ~66
         93        FETCH_DIM_R                                      ~68     !0, 2
         94        BW_AND                                           ~69     ~68, 63
         95        SL                                               ~70     ~69, 6
         96        BW_OR                                            ~71     ~67, ~70
         97        FETCH_DIM_R                                      ~72     !0, 3
         98        BW_AND                                           ~73     ~72, 63
         99        BW_OR                                            ~74     ~71, ~73
        100        ASSIGN                                                   !2, ~74
   29   101      > RETURN                                                   4
   32   102    > > RETURN                                                   0
   33   103*     > RETURN                                                   null

End of function decodeutf8character

Function encodeutf8codepoint:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 27
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 42
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecDhJ
function name:  encodeUtf8CodePoint
number of ops:  63
compiled vars:  !0 = $codePoint
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   38     1        IS_SMALLER                                               !0, 128
          2      > JMPNZ                                                    ~2, ->10
   41     3    >   IS_SMALLER                                               !0, 2048
          4      > JMPNZ                                                    ~3, ->16
   44     5    >   IS_SMALLER                                               !0, 65536
          6      > JMPNZ                                                    ~4, ->27
   47     7    >   IS_SMALLER                                               !0, 1114112
          8      > JMPNZ                                                    ~5, ->42
          9    > > JMP                                                      ->61
   39    10    >   INIT_FCALL                                               'pack'
         11        SEND_VAL                                                 'C%2A'
         12        BW_AND                                           ~6      !0, 127
         13        SEND_VAL                                                 ~6
         14        DO_ICALL                                         $7      
         15      > RETURN                                                   $7
   42    16    >   INIT_FCALL                                               'pack'
         17        SEND_VAL                                                 'C%2A'
         18        BW_AND                                           ~8      !0, 1984
         19        SR                                               ~9      ~8, 6
         20        BW_OR                                            ~10     ~9, 192
         21        SEND_VAL                                                 ~10
         22        BW_AND                                           ~11     !0, 63
         23        BW_OR                                            ~12     ~11, 128
         24        SEND_VAL                                                 ~12
         25        DO_ICALL                                         $13     
         26      > RETURN                                                   $13
   45    27    >   INIT_FCALL                                               'pack'
         28        SEND_VAL                                                 'C%2A'
         29        BW_AND                                           ~14     !0, 61440
         30        SR                                               ~15     ~14, 12
         31        BW_OR                                            ~16     ~15, 224
         32        SEND_VAL                                                 ~16
         33        BW_AND                                           ~17     !0, 4032
         34        SR                                               ~18     ~17, 6
         35        BW_OR                                            ~19     ~18, 128
         36        SEND_VAL                                                 ~19
         37        BW_AND                                           ~20     !0, 63
         38        BW_OR                                            ~21     ~20, 128
         39        SEND_VAL                                                 ~21
         40        DO_ICALL                                         $22     
         41      > RETURN                                                   $22
   48    42    >   INIT_FCALL                                               'pack'
         43        SEND_VAL                                                 'C%2A'
         44        BW_AND                                           ~23     !0, 1835008
         45        SR                                               ~24     ~23, 18
         46        BW_OR                                            ~25     ~24, 240
         47        SEND_VAL                                                 ~25
         48        BW_AND                                           ~26     !0, 258048
         49        SR                                               ~27     ~26, 12
         50        BW_OR                                            ~28     ~27, 128
         51        SEND_VAL                                                 ~28
         52        BW_AND                                           ~29     !0, 4032
         53        SR                                               ~30     ~29, 6
         54        BW_OR                                            ~31     ~30, 128
         55        SEND_VAL                                                 ~31
         56        BW_AND                                           ~32     !0, 63
         57        BW_OR                                            ~33     ~32, 128
         58        SEND_VAL                                                 ~33
         59        DO_ICALL                                         $34     
         60      > RETURN                                                   $34
   51    61    > > RETURN                                                   <false>
   52    62*     > RETURN                                                   null

End of function encodeutf8codepoint

Function isdnslabelchar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 47) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 20
Branch analysis from position: 14
Branch analysis from position: 10
Branch analysis from position: 11
Branch analysis from position: 5
filename:       /in/ecDhJ
function name:  isDnsLabelChar
number of ops:  22
compiled vars:  !0 = $charCode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   54     0  E >   RECV                                             !0      
   56     1        IS_SMALLER_OR_EQUAL                              ~1      97, !0
          2      > JMPZ_EX                                          ~1      ~1, ->5
          3    >   IS_SMALLER_OR_EQUAL                              ~2      !0, 122
          4        BOOL                                             ~1      ~2
          5    > > JMPNZ_EX                                         ~1      ~1, ->11
   57     6    >   IS_SMALLER_OR_EQUAL                              ~3      48, !0
          7      > JMPZ_EX                                          ~3      ~3, ->10
          8    >   IS_SMALLER_OR_EQUAL                              ~4      !0, 57
          9        BOOL                                             ~3      ~4
         10    >   BOOL                                             ~1      ~3
         11    > > JMPNZ_EX                                         ~1      ~1, ->14
   58    12    >   IS_IDENTICAL                                     ~5      !0, 45
         13        BOOL                                             ~1      ~5
         14    > > JMPNZ_EX                                         ~1      ~1, ->20
   59    15    >   IS_SMALLER_OR_EQUAL                              ~6      65, !0
         16      > JMPZ_EX                                          ~6      ~6, ->19
         17    >   IS_SMALLER_OR_EQUAL                              ~7      !0, 90
         18        BOOL                                             ~6      ~7
         19    >   BOOL                                             ~1      ~6
         20    > > RETURN                                                   ~1
   60    21*     > RETURN                                                   null

End of function isdnslabelchar

Function isprintablelatin1char:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecDhJ
function name:  isPrintableLatin1Char
number of ops:  4
compiled vars:  !0 = $charCode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   RECV                                             !0      
   64     1        IS_SMALLER_OR_EQUAL                              ~1      160, !0
          2      > RETURN                                                   ~1
   65     3*     > RETURN                                                   null

End of function isprintablelatin1char

Function getencodingparts:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 129
Branch analysis from position: 129
2 jumps found. (Code = 44) Position 1 = 131, Position 2 = 9
Branch analysis from position: 131
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 118
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 106
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 37
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 105
Branch analysis from position: 105
1 jumps found. (Code = 42) Position 1 = 117
Branch analysis from position: 117
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
2 jumps found. (Code = 44) Position 1 = 131, Position 2 = 9
Branch analysis from position: 131
Branch analysis from position: 9
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 43
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 100
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 87
Branch analysis from position: 87
2 jumps found. (Code = 44) Position 1 = 89, Position 2 = 52
Branch analysis from position: 89
1 jumps found. (Code = 42) Position 1 = 105
Branch analysis from position: 105
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 82
Branch analysis from position: 82
2 jumps found. (Code = 44) Position 1 = 86, Position 2 = 69
Branch analysis from position: 86
2 jumps found. (Code = 44) Position 1 = 89, Position 2 = 52
Branch analysis from position: 89
Branch analysis from position: 52
Branch analysis from position: 69
2 jumps found. (Code = 44) Position 1 = 86, Position 2 = 69
Branch analysis from position: 86
Branch analysis from position: 69
Branch analysis from position: 100
1 jumps found. (Code = 42) Position 1 = 117
Branch analysis from position: 117
Branch analysis from position: 106
2 jumps found. (Code = 43) Position 1 = 110, Position 2 = 116
Branch analysis from position: 110
1 jumps found. (Code = 42) Position 1 = 117
Branch analysis from position: 117
Branch analysis from position: 116
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 118
2 jumps found. (Code = 43) Position 1 = 122, Position 2 = 127
Branch analysis from position: 122
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
Branch analysis from position: 127
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecDhJ
function name:  getEncodingParts
number of ops:  133
compiled vars:  !0 = $input, !1 = $output, !2 = $nonBasicChars, !3 = $isUtf8, !4 = $i, !5 = $p, !6 = $l, !7 = $charCode, !8 = $len, !9 = $codePoint, !10 = $offset, !11 = $j, !12 = $base, !13 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   67     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
          2        RECV_INIT                                        !2      <array>
   69     3        ASSIGN                                                   !3, <true>
   71     4        ASSIGN                                           ~15     !5, 0
          5        ASSIGN                                                   !4, ~15
          6        STRLEN                                           ~17     !0
          7        ASSIGN                                                   !6, ~17
          8      > JMP                                                      ->129
   72     9    >   INIT_FCALL                                               'ord'
         10        FETCH_DIM_R                                      ~19     !0, !4
         11        SEND_VAL                                                 ~19
         12        DO_ICALL                                         $20     
         13        ASSIGN                                                   !7, $20
   74    14        BW_AND                                           ~22     !7, 128
         15      > JMPZ                                                     ~22, ->118
   75    16    > > JMPZ                                                     !3, ->106
   76    17    >   INIT_METHOD_CALL                                         'decodeUtf8Character'
         18        SEND_VAR                                                 !0
         19        SEND_VAR                                                 !4
         20        SEND_REF                                                 !9
         21        DO_FCALL                                      0  $23     
         22        ASSIGN                                           ~24     !8, $23
         23      > JMPZ                                                     ~24, ->37
   77    24    >   INIT_ARRAY                                       ~26     !5
         25        ADD_ARRAY_ELEMENT                                ~26     !9
         26        INIT_FCALL                                               'substr'
         27        SEND_VAR                                                 !0
         28        SEND_VAR                                                 !4
         29        SEND_VAR                                                 !8
         30        DO_ICALL                                         $27     
         31        ADD_ARRAY_ELEMENT                                ~26     $27
         32        ADD_ARRAY_ELEMENT                                ~26     !8
         33        ASSIGN_DIM                                               !2
         34        OP_DATA                                                  ~26
   78    35        ASSIGN_OP                                     1          !4, !8
         36      > JMP                                                      ->105
   81    37    >   INIT_METHOD_CALL                                         'isPrintableLatin1Char'
         38        SEND_VAR                                                 !7
         39        DO_FCALL                                      0  $29     
         40        BOOL_NOT                                         ~30     $29
         41      > JMPZ                                                     ~30, ->43
   82    42    > > RETURN                                                   <false>
   85    43    >   ASSIGN                                                   !3, <false>
   87    44        ISSET_ISEMPTY_CV                                 ~32     !2
         45        BOOL_NOT                                         ~33     ~32
         46      > JMPZ                                                     ~33, ->100
   88    47    >   ASSIGN                                                   !10, 0
   90    48        ASSIGN                                                   !11, 0
         49        COUNT                                            ~36     !2
         50        ASSIGN                                                   !6, ~36
         51      > JMP                                                      ->87
   91    52    >   FETCH_DIM_R                                      ~38     !2, !11
         53        FETCH_DIM_R                                      ~39     ~38, 0
         54        ASSIGN                                                   !12, ~39
   92    55        FETCH_DIM_RW                                     $41     !2, !11
         56        ASSIGN_DIM_OP                +=               1          $41, 0
         57        OP_DATA                                                  !10
   93    58        INIT_FCALL                                               'ord'
         59        FETCH_DIM_R                                      ~45     !2, !11
         60        FETCH_DIM_R                                      ~46     ~45, 2
         61        FETCH_DIM_R                                      ~47     ~46, 0
         62        SEND_VAL                                                 ~47
         63        DO_ICALL                                         $48     
         64        FETCH_DIM_W                                      $43     !2, !11
         65        ASSIGN_DIM                                               $43, 1
         66        OP_DATA                                                  $48
   95    67        ASSIGN                                                   !13, 1
         68      > JMP                                                      ->82
   96    69    >   PRE_INC                                          ~51     !10
         70        ADD                                              ~52     !12, ~51
         71        INIT_ARRAY                                       ~53     ~52
         72        INIT_FCALL                                               'ord'
         73        FETCH_DIM_R                                      ~54     !2, !11
         74        FETCH_DIM_R                                      ~55     ~54, 2
         75        FETCH_DIM_R                                      ~56     ~55, !13
         76        SEND_VAL                                                 ~56
         77        DO_ICALL                                         $57     
         78        ADD_ARRAY_ELEMENT                                ~53     $57
         79        ASSIGN_DIM                                               !2
         80        OP_DATA                                                  ~53
   95    81        PRE_INC                                                  !13
         82    >   FETCH_DIM_R                                      ~59     !2, !11
         83        FETCH_DIM_R                                      ~60     ~59, 3
         84        IS_SMALLER                                               !13, 

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
254.3 ms | 1428 KiB | 24 Q