3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class UrlScraper { private static $encoding; private static $array; private static function call($name) { return array(__CLASS__, $name); } private static function checkEmpty($dir) { return $dir !== '.' && $dir !== ''; } private static function htmlDecode($html) { return html_entity_decode($html, ENT_QUOTES, self::$encoding); } private static function mergeRecursive($item) { if (!self::checkEmpty($item)) { self::$array[] = $item; } } private static function parseUrl($url, $is_base = false) { if ( strpos($url, 'javascript:') === 0 or false === $p = parse_url($url) or $is_base && !isset($p['host']) ) { throw new InvalidArgumentException('Invalid URL'); } $p['scheme'] = isset($p['scheme']) ? $p['scheme'] . '://' : 'http://'; $p['port'] = isset($p['port']) ? ':' . $p['port'] : ''; $p['path'] = isset($p['path']) ? $p['path'] : ''; $q['head'] = isset($p['host']) ? $p['scheme'] . $p['host'] . $p['port'] : ''; $q['query'] = isset($p['query']) ? '?' . $p['query'] : ''; $q['fragment'] = isset($p['fragment']) ? '#' . $p['fragment'] : ''; $q['dirs'] = explode('/', $p['path']); $q['is_abs'] = $p['path'] !== '' && $q['dirs'][0] === ''; $q['is_dir'] = end($q['dirs']) === ''; $q['dirs'] = array_values(array_filter($q['dirs'], self::call('checkEmpty'))); return $q; } public static function parseLinks($html, $base_url = null, $encoding = 'UTF-8') { $regex = '@<a[^>]*?(?<!\.)href="([^"]*+)"[^>]*+>(.*?)</a>@si'; if (!preg_match_all($regex, $html, $matches, PREG_SET_ORDER)) { return array(); } if ($base_url !== null) { $p = self::parseUrl($base_url, true);; if (!$p['is_dir']) { array_pop($p['dirs']); } } $array = array(); foreach ($matches as $match) { list(, $set['href'], $set['label']) = $match; try { $q = self::parseUrl($set['href']); if ($base_url === null) { if ($q['head'] === '' && $q['query'] === '' && !$q['dirs'] && !$q['is_abs']) { continue; } } else { if ($q['head'] === '') { $tmp = $q['is_abs'] ? array() : $p['dirs']; foreach ($q['dirs'] as $dir) { if ($dir === '..') { array_pop($tmp); } } self::$array = array(); call_user_func( 'array_walk_recursive', array($p['head'], $tmp, $q['query'], $q['fragment']), self::call('mergeRecursive') ); $set['href'] = implode('/', self::$array); } else { $tmp = array_filter($q['dirs'], self::call('checkEmpty')); } if ($p['dirs'] === $tmp && $p['query'] === $q['query']) { continue; } } $set['label'] = ( '' === $text = trim(strip_tags($set['label'])) and preg_match_all('@(?<!\.)alt="([^"]++)"@', $set['label'], $matches) ) ? implode(' - ', $matches[1]) : $text ; self::$encoding = $encoding; $set = array_map(self::call('htmlDecode'), $set); $array[serialize($set)] = $set; } catch (Exception $e) { } } return array_values($array); } } $html = <<<EOD <a href="jump.php">画像A[TEXT]<img src="image_a.png" alt="画像A[ALT]" /></a> <a href="jump.php"><img src="image_a.png" alt="画像B[ALT]" /></a> EOD; $base_url = 'http://example.com/foo/bar/'; $base_url = null; var_dump($base_url, UrlScraper::parseLinks($html, $base_url));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NL3hl
function name:  (null)
number of ops:  12
compiled vars:  !0 = $html, !1 = $base_url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  107     0  E >   ASSIGN                                                   !0, '%3Ca+href%3D%22jump.php%22%3E%E7%94%BB%E5%83%8FA%5BTEXT%5D%3Cimg+src%3D%22image_a.png%22+alt%3D%22%E7%94%BB%E5%83%8FA%5BALT%5D%22+%2F%3E%3C%2Fa%3E%0A%3Ca+href%3D%22jump.php%22%3E%3Cimg+src%3D%22image_a.png%22+alt%3D%22%E7%94%BB%E5%83%8FB%5BALT%5D%22+%2F%3E%3C%2Fa%3E'
  112     1        ASSIGN                                                   !1, 'http%3A%2F%2Fexample.com%2Ffoo%2Fbar%2F'
  113     2        ASSIGN                                                   !1, null
  115     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !1
          5        INIT_STATIC_METHOD_CALL                                  'UrlScraper', 'parseLinks'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_FCALL                                      0  $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class UrlScraper:
Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NL3hl
function name:  call
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_ARRAY                                       ~1      'UrlScraper'
          2        ADD_ARRAY_ELEMENT                                ~1      !0
          3      > RETURN                                                   ~1
   10     4*     > RETURN                                                   null

End of function call

Function checkempty:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/NL3hl
function name:  checkEmpty
number of ops:  7
compiled vars:  !0 = $dir
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        IS_NOT_IDENTICAL                                 ~1      !0, '.'
          2      > JMPZ_EX                                          ~1      ~1, ->5
          3    >   IS_NOT_IDENTICAL                                 ~2      !0, ''
          4        BOOL                                             ~1      ~2
          5    > > RETURN                                                   ~1
   14     6*     > RETURN                                                   null

End of function checkempty

Function htmldecode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NL3hl
function name:  htmlDecode
number of ops:  9
compiled vars:  !0 = $html
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'html_entity_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 3
          4        FETCH_STATIC_PROP_R          global lock         ~1      'encoding'
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
   18     8*     > RETURN                                                   null

End of function htmldecode

Function mergerecursive:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/NL3hl
function name:  mergeRecursive
number of ops:  10
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        INIT_STATIC_METHOD_CALL                                  'checkEmpty'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $1      
          4        BOOL_NOT                                         ~2      $1
          5      > JMPZ                                                     ~2, ->9
   22     6    >   FETCH_STATIC_PROP_W          unknown             $3      'array'
          7        ASSIGN_DIM                                               $3
          8        OP_DATA                                                  !0
   24     9    > > RETURN                                                   null

End of function mergerecursive

Function parseurl:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 47) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 31
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 40
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 48
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 60
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 69
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 78
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
2 jumps found. (Code = 46) Position 1 = 91, Position 2 = 95
Branch analysis from position: 91
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 95
Branch analysis from position: 78
2 jumps found. (Code = 46) Position 1 = 91, Position 2 = 95
Branch analysis from position: 91
Branch analysis from position: 95
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 78
Branch analysis from position: 74
Branch analysis from position: 78
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 69
Branch analysis from position: 65
Branch analysis from position: 69
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 60
Branch analysis from position: 53
Branch analysis from position: 60
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 48
Branch analysis from position: 45
Branch analysis from position: 48
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 40
Branch analysis from position: 36
Branch analysis from position: 40
Branch analysis from position: 19
Branch analysis from position: 20
Branch analysis from position: 14
filename:       /in/NL3hl
function name:  parseUrl
number of ops:  119
compiled vars:  !0 = $url, !1 = $is_base, !2 = $p, !3 = $q
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
   28     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'javascript%3A'
          5        DO_ICALL                                         $4      
          6        IS_IDENTICAL                                     ~5      $4, 0
          7      > JMPNZ_EX                                         ~5      ~5, ->14
   29     8    >   INIT_FCALL                                               'parse_url'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $6      
         11        ASSIGN                                           ~7      !2, $6
         12        TYPE_CHECK                                    4  ~8      ~7
         13        BOOL                                             ~5      ~8
         14    > > JMPNZ_EX                                         ~5      ~5, ->20
   30    15    > > JMPZ_EX                                          ~9      !1, ->19
         16    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !2, 'host'
         17        BOOL_NOT                                         ~11     ~10
         18        BOOL                                             ~9      ~11
         19    >   BOOL                                             ~5      ~9
         20    > > JMPZ                                                     ~5, ->25
   32    21    >   NEW                                              $12     'InvalidArgumentException'
         22        SEND_VAL_EX                                              'Invalid+URL'
         23        DO_FCALL                                      0          
         24      > THROW                                         0          $12
   34    25    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'scheme'
         26      > JMPZ                                                     ~15, ->31
         27    >   FETCH_DIM_R                                      ~16     !2, 'scheme'
         28        CONCAT                                           ~17     ~16, '%3A%2F%2F'
         29        QM_ASSIGN                                        ~18     ~17
         30      > JMP                                                      ->32
         31    >   QM_ASSIGN                                        ~18     'http%3A%2F%2F'
         32    >   ASSIGN_DIM                                               !2, 'scheme'
         33        OP_DATA                                                  ~18
   35    34        ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'port'
         35      > JMPZ                                                     ~20, ->40
         36    >   FETCH_DIM_R                                      ~21     !2, 'port'
         37        CONCAT                                           ~22     '%3A', ~21
         38        QM_ASSIGN                                        ~23     ~22
         39      > JMP                                                      ->41
         40    >   QM_ASSIGN                                        ~23     ''
         41    >   ASSIGN_DIM                                               !2, 'port'
         42        OP_DATA                                                  ~23
   36    43        ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'path'
         44      > JMPZ                                                     ~25, ->48
         45    >   FETCH_DIM_R                                      ~26     !2, 'path'
         46        QM_ASSIGN                                        ~27     ~26
         47      > JMP                                                      ->49
         48    >   QM_ASSIGN                                        ~27     ''
         49    >   ASSIGN_DIM                                               !2, 'path'
         50        OP_DATA                                                  ~27
   37    51        ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'host'
         52      > JMPZ                                                     ~29, ->60
         53    >   FETCH_DIM_R                                      ~30     !2, 'scheme'
         54        FETCH_DIM_R                                      ~31     !2, 'host'
         55        CONCAT                                           ~32     ~30, ~31
         56        FETCH_DIM_R                                      ~33     !2, 'port'
         57        CONCAT                                           ~34     ~32, ~33
         58        QM_ASSIGN                                        ~35     ~34
         59      > JMP                                                      ->61
         60    >   QM_ASSIGN                                        ~35     ''
         61    >   ASSIGN_DIM                                               !3, 'head'
         62        OP_DATA                                                  ~35
   38    63        ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'query'
         64      > JMPZ                                                     ~37, ->69
         65    >   FETCH_DIM_R                                      ~38     !2, 'query'
         66        CONCAT                                           ~39     '%3F', ~38
         67        QM_ASSIGN                                        ~40     ~39
         68      > JMP                                                      ->70
         69    >   QM_ASSIGN                                        ~40     ''
         70    >   ASSIGN_DIM                                               !3, 'query'
         71        OP_DATA                                                  ~40
   39    72        ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'fragment'
         73      > JMPZ                                                     ~42, ->78
         74    >   FETCH_DIM_R                                      ~43     !2, 'fragment'
         75        CONCAT                                           ~44     '%23', ~43
         76        QM_ASSIGN                                        ~45     ~44
         77      > JMP                                                      ->79
         78    >   QM_ASSIGN                                        ~45     ''
         79    >   ASSIGN_DIM                                               !3, 'fragment'
         80        OP_DATA                                                  ~45
   40    81        INIT_FCALL                                               'explode'
         82        SEND_VAL                                                 '%2F'
         83        FETCH_DIM_R                                      ~47     !2, 'path'
         84        SEND_VAL                                                 ~47
         85        DO_ICALL                                         $48     
         86        ASSIGN_DIM                                               !3, 'dirs'
         87        OP_DATA                                                  $48
   41    88        FETCH_DIM_R                                      ~50     !2, 'path'
         89        IS_NOT_IDENTICAL                                 ~51     ~50, ''
         90      > JMPZ_EX                                          ~51     ~51, ->95
         91    >   FETCH_DIM_R                                      ~52     !3, 'dirs'
         92        FETCH_DIM_R                                      ~53     ~52, 0
         93        IS_IDENTICAL                                     ~54     ~53, ''
         94        BOOL                                             ~51     ~54
         95    >   ASSIGN_DIM                                               !3, 'is_abs'
         96        OP_DATA                                                  ~51
   42    97        INIT_FCALL                                               'end'
         98        FETCH_DIM_W                                      $56     !3, 'dirs'
         99        SEND_REF                                                 $56
        100        DO_ICALL                                         $57     
        101        IS_IDENTICAL                                     ~58     $57, ''
        102        ASSIGN_DIM                                               !3, 'is_dir'
        103        OP_DATA                                                  ~58
   43   104        INIT_FCALL                                               'array_values'
        105        INIT_FCALL                                               'array_filter'
        106        FETCH_DIM_R                                      ~60     !3, 'dirs'
        107        SEND_VAL                                                 ~60
        108        INIT_STATIC_METHOD_CALL                                  'call'
        109        SEND_VAL                                                 'checkEmpty'
        110        DO_FCALL                                      0  $61     
        111        SEND_VAR                                                 $61
        112        DO_ICALL                                         $62     
        113        SEND_VAR                                                 $62
        114        DO_ICALL                                         $63     
        115        ASSIGN_DIM                                               !3, 'dirs'
        116        OP_DATA                                                  $63
   44   117      > RETURN                                                   !3
   45   118*     > RETURN                                                   null

End of function parseurl

Function parselinks:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 27
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
2 jumps found. (Code = 77) Position 1 = 29, Position 2 = 170
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 170
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 62
Branch analysis from position: 45
2 jumps found. (Code = 46) Position 1 = 48, Position 2 = 51
Branch analysis from position: 48
2 jumps found. (Code = 46) Position 1 = 52, Position 2 = 55
Branch analysis from position: 52
2 jumps found. (Code = 46) Position 1 = 56, Position 2 = 59
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 61
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 124
Branch analysis from position: 124
2 jumps found. (Code = 46) Position 1 = 134, Position 2 = 141
Branch analysis from position: 134
2 jumps found. (Code = 43) Position 1 = 142, Position 2 = 149
Branch analysis from position: 142
1 jumps found. (Code = 42) Position 1 = 150
Branch analysis from position: 150
1 jumps found. (Code = 42) Position 1 = 169
Branch analysis from position: 169
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 149
1 jumps found. (Code = 42) Position 1 = 169
Branch analysis from position: 169
Branch analysis from position: 141
Branch analysis from position: 59
Branch analysis from position: 55
Branch analysis from position: 51
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 106
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 69
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
2 jumps found. (Code = 77) Position 1 = 74, Position 2 = 81
Branch analysis from position: 74
2 jumps found. (Code = 78) Position 1 = 75, Position 2 = 81
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 77, Position 2 = 80
Branch analysis from position: 77
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 80
Branch analysis from position: 81
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
2 jumps found. (Code = 46) Position 1 = 118, Position 2 = 122
Branch analysis from position: 118
2 jumps found. (Code = 43) Position 1 = 123, Position 2 = 124
Branch analysis from position: 123
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 124
Branch analysis from position: 122
Branch analysis from position: 81
Branch analysis from position: 69
2 jumps found. (Code = 77) Position 1 = 74, Position 2 = 81
Branch analysis from position: 74
Branch analysis from position: 81
Branch analysis from position: 106
2 jumps found. (Code = 46) Position 1 = 118, Position 2 = 122
Branch analysis from position: 118
Branch analysis from position: 122
Branch analysis from position: 170
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 170
Branch analysis from position: 27
Branch analysis from position: 27
Found catch point at position: 168
Branch analysis from position: 168
2 jumps found. (Code = 107) Position 1 = 169, Position 2 = -2
Branch analysis from position: 169
filename:       /in/NL3hl
function name:  parseLinks
number of ops:  176
compiled vars:  !0 = $html, !1 = $base_url, !2 = $encoding, !3 = $regex, !4 = $matches, !5 = $p, !6 = $array, !7 = $match, !8 = $set, !9 = $q, !10 = $tmp, !11 = $dir, !12 = $text, !13 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      'UTF-8'
   48     3        ASSIGN                                                   !3, '%40%3Ca%5B%5E%3E%5D%2A%3F%28%3F%3C%21%5C.%29href%3D%22%28%5B%5E%22%5D%2A%2B%29%22%5B%5E%3E%5D%2A%2B%3E%28.%2A%3F%29%3C%2Fa%3E%40si'
   49     4        INIT_FCALL                                               'preg_match_all'
          5        SEND_VAR                                                 !3
          6        SEND_VAR                                                 !0
          7        SEND_REF                                                 !4
          8        SEND_VAL                                                 2
          9        DO_ICALL                                         $15     
         10        BOOL_NOT                                         ~16     $15
         11      > JMPZ                                                     ~16, ->13
   50    12    > > RETURN                                                   <array>
   52    13    >   TYPE_CHECK                                  1020          !1
         14      > JMPZ                                                     ~17, ->27
   53    15    >   INIT_STATIC_METHOD_CALL                                  'parseUrl'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 <true>
         18        DO_FCALL                                      0  $18     
         19        ASSIGN                                                   !5, $18
   54    20        FETCH_DIM_R                                      ~20     !5, 'is_dir'
         21        BOOL_NOT                                         ~21     ~20
         22      > JMPZ                                                     ~21, ->27
   55    23    >   INIT_FCALL                                               'array_pop'
         24        FETCH_DIM_W                                      $22     !5, 'dirs'
         25        SEND_REF                                                 $22
         26        DO_ICALL                                                 
   58    27    >   ASSIGN                                                   !6, <array>
   59    28      > FE_RESET_R                                       $25     !4, ->170
         29    > > FE_FETCH_R                                               $25, !7, ->170
   60    30    >   QM_ASSIGN                                        ~26     !7
         31        FETCH_LIST_R                                     $27     ~26, 1
         32        ASSIGN_DIM                                               !8, 'href'
         33        OP_DATA                                                  $27
         34        FETCH_LIST_R                                     $29     ~26, 2
         35        ASSIGN_DIM                                               !8, 'label'
         36        OP_DATA                                                  $29
         37        FREE                                                     ~26
   62    38        INIT_STATIC_METHOD_CALL                                  'parseUrl'
         39        FETCH_DIM_R                                      ~31     !8, 'href'
         40        SEND_VAL                                                 ~31
         41        DO_FCALL                                      0  $32     
         42        ASSIGN                                                   !9, $32
   63    43        TYPE_CHECK                                    2          !1
         44      > JMPZ                                                     ~34, ->62
   64    45    >   FETCH_DIM_R                                      ~35     !9, 'head'
         46        IS_IDENTICAL                                     ~36     ~35, ''
         47      > JMPZ_EX                                          ~36     ~36, ->51
         48    >   FETCH_DIM_R                                      ~37     !9, 'query'
         49        IS_IDENTICAL                                     ~38     ~37, ''
         50        BOOL                                             ~36     ~38
         51    > > JMPZ_EX                                          ~36     ~36, ->55
         52    >   FETCH_DIM_R                                      ~39     !9, 'dirs'
         53        BOOL_NOT                                         ~40     ~39
         54        BOOL                                             ~36     ~40
         55    > > JMPZ_EX                                          ~36     ~36, ->59
         56    >   FETCH_DIM_R                                      ~41     !9, 'is_abs'
         57        BOOL_NOT                                         ~42     ~41
         58        BOOL                                             ~36     ~42
         59    > > JMPZ                                                     ~36, ->61
   65    60    > > JMP                                                      ->29
         61    > > JMP                                                      ->124
   68    62    >   FETCH_DIM_R                                      ~43     !9, 'head'
         63        IS_IDENTICAL                                             ~43, ''
         64      > JMPZ                                                     ~44, ->106
   69    65    >   FETCH_DIM_R                                      ~45     !9, 'is_abs'
         66      > JMPZ                                                     ~45, ->69
         67    >   QM_ASSIGN                                        ~46     <array>
         68      > JMP                                                      ->71
         69    >   FETCH_DIM_R                                      ~47     !5, 'dirs'
         70        QM_ASSIGN                                        ~46     ~47
         71    >   ASSIGN                                                   !10, ~46
   70    72        FETCH_DIM_R                                      ~49     !9, 'dirs'
         73      > FE_RESET_R                                       $50     ~49, ->81
         74    > > FE_FETCH_R                                               $50, !11, ->81
   71    75    >   IS_IDENTICAL                                             !11, '..'
         76      > JMPZ                                                     ~51, ->80
   72    77    >   INIT_FCALL                                               'array_pop'
         78        SEND_REF                                                 !10
         79        DO_ICALL                                                 
   70    80    > > JMP                                                      ->74
         81    >   FE_FREE                                                  $50
   75    82        ASSIGN_STATIC_PROP                                       'array'
         83        OP_DATA                                                  <array>
   76    84        INIT_FCALL                                               'array_walk_recursive'
   78    85        FETCH_DIM_R                                      ~54     !5, 'head'
         86        INIT_ARRAY                                       ~55     ~54
         87        ADD_ARRAY_ELEMENT                                ~55     !10
         88        FETCH_DIM_R                                      ~56     !9, 'query'
         89        ADD_ARRAY_ELEMENT                                ~55     ~56
         90        FETCH_DIM_R                                      ~57     !9, 'fragment'
         91        ADD_ARRAY_ELEMENT                                ~55     ~57
         92        SEND_USER                                                ~55
   79    93        INIT_STATIC_METHOD_CALL                                  'call'
         94        SEND_VAL                                                 'mergeRecursive'
         95        DO_FCALL                                      0  $58     
         96        SEND_USER                                                $58
         97        DO_FCALL                                      0          
   81    98        INIT_FCALL                                               'implode'
         99        SEND_VAL                                                 '%2F'
        100        FETCH_STATIC_PROP_R          unknown             ~61     'array'
        101        SEND_VAL                                                 ~61
        102        DO_ICALL                                         $62     
        103        ASSIGN_DIM                                               !8, 'href'
        104        OP_DATA                                                  $62
        105      > JMP                                                      ->115
   83   106    >   INIT_FCALL                                               'array_filter'
        107        FETCH_DIM_R                                      ~63     !9, 'dirs'
        108        SEND_VAL                                                 ~63
        109        INIT_STATIC_METHOD_CALL                                  'call'
        110      

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.76 ms | 1428 KiB | 37 Q