3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @author Oscar Casajuana a.k.a. elboletaire <elboletaire {at} underave {dot} net> */ /* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/> */ class Crawler { private $depth = 2; private $url; private $results = array(); private $same_host = false; private $host; public function setDepth($depth) { $this->depth = $depth; } public function setHost($host) { $this->host = $host; } public function getResults() { return $this->results; } public function setSameHost($same_host) { $this->same_host = $same_host; } public function setUrl($url) { $this->url = $url; $this->setHost($this->getHostFromUrl($url)); } public function __construct($url = null, $depth = null, $same_host = false) { if (!empty($url)) { $this->setUrl($url); } if (isset($depth) && !is_null($depth)) { $this->setDepth($depth); } $this->setSameHost($same_host); } public function crawl() { if (empty($this->url)) { throw new Exception('URL must be set'); } $this->_crawl($this->url, $this->depth); return $this->results; } private function _crawl($url, $depth) { static $seen = array(); if (empty($url)) return; if (!$url = $this->buildUrl($this->url, $url)) { return; } if ($depth === 0 || isset($seen[$url])) { return; } $seen[$url] = true; $dom = new DOMDocument('1.0'); @$dom->loadHTMLFile($url); $this->results[] = array( 'url' => $url, // 'content' => $dom->saveHTML() ); $anchors = $dom->getElementsByTagName('a'); foreach ($anchors as $element) { if (!$href = $this->buildUrl($url, $element->getAttribute('href'))) { continue; } $this->_crawl($href, $depth - 1); } return $url; } private function buildUrl($url, $href) { if (0 !== strpos($href, 'http')) { if (0 === strpos($href, 'javascript:') || 0 === strpos($href, '#')) { return false; } $path = '/' . ltrim($href, '/'); if (extension_loaded('http')) { $new_href = http_build_url($url, array('path' => $path), HTTP_URL_REPLACE, $parts); } else { $parts = parse_url($url); $new_href = $this->buildUrlFromParts($parts); $new_href .= $path; } // Relative urls... (like ./viewforum.php) if (0 === strpos($href, './') && !empty($parts['path'])) { // If the path isn't really a path (doesn't end with slash)... if (!preg_match('@/$@', $parts['path'])) { $path_parts = explode('/', $parts['path']); array_pop($path_parts); $parts['path'] = implode('/', $path_parts) . '/'; } $new_href = $this->buildUrlFromParts($parts) . $parts['path'] . ltrim($href, './'); } $href = $new_href; } $href = rtrim($href, '/'); if ($this->same_host && $this->host != $this->getHostFromUrl($href)) { return false; } return $href; } private function buildUrlFromParts($parts) { $new_href = $parts['scheme'] . '://'; if (isset($parts['user']) && isset($parts['pass'])) { $new_href .= $parts['user'] . ':' . $parts['pass'] . '@'; } $new_href .= $parts['host']; if (isset($parts['port'])) { $new_href .= ':' . $parts['port']; } return $new_href; } private function getHostFromUrl($url) { $parts = parse_url($url); preg_match("@([^/.]+)\.([^.]{2,6}(?:\.[^.]{2,3})?)$@", $parts['host'], $host); return array_shift($host); } } Crawler::crawl("http://google.com");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obfSR
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  156     0  E >   INIT_STATIC_METHOD_CALL                                  'Crawler', 'crawl'
          1        SEND_VAL                                                 'http%3A%2F%2Fgoogle.com'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Class Crawler:
Function setdepth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obfSR
function name:  setDepth
number of ops:  4
compiled vars:  !0 = $depth
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'depth'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function setdepth

Function sethost:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obfSR
function name:  setHost
number of ops:  4
compiled vars:  !0 = $host
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'host'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function sethost

Function getresults:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obfSR
function name:  getResults
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~0      'results'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getresults

Function setsamehost:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obfSR
function name:  setSameHost
number of ops:  4
compiled vars:  !0 = $same_host
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'same_host'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function setsamehost

Function seturl:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obfSR
function name:  setUrl
number of ops:  10
compiled vars:  !0 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
   35     1        ASSIGN_OBJ                                               'url'
          2        OP_DATA                                                  !0
   36     3        INIT_METHOD_CALL                                         'setHost'
          4        INIT_METHOD_CALL                                         'getHostFromUrl'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR_NO_REF_EX                                       $2
          8        DO_FCALL                                      0          
   37     9      > RETURN                                                   null

End of function seturl

Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
Branch analysis from position: 14
Branch analysis from position: 9
filename:       /in/obfSR
function name:  __construct
number of ops:  22
compiled vars:  !0 = $url, !1 = $depth, !2 = $same_host
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      <false>
   41     3        ISSET_ISEMPTY_CV                                 ~3      !0
          4        BOOL_NOT                                         ~4      ~3
          5      > JMPZ                                                     ~4, ->9
   42     6    >   INIT_METHOD_CALL                                         'setUrl'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   44     9    >   ISSET_ISEMPTY_CV                                 ~6      !1
         10      > JMPZ_EX                                          ~6      ~6, ->14
         11    >   TYPE_CHECK                                    2  ~7      !1
         12        BOOL_NOT                                         ~8      ~7
         13        BOOL                                             ~6      ~8
         14    > > JMPZ                                                     ~6, ->18
   45    15    >   INIT_METHOD_CALL                                         'setDepth'
         16        SEND_VAR_EX                                              !1
         17        DO_FCALL                                      0          
   47    18    >   INIT_METHOD_CALL                                         'setSameHost'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
   48    21      > RETURN                                                   null

End of function __construct

Function crawl:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obfSR
function name:  crawl
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   ISSET_ISEMPTY_PROP_OBJ                                   'url'
          1      > JMPZ                                                     ~0, ->6
   53     2    >   NEW                                              $1      'Exception'
          3        SEND_VAL_EX                                              'URL+must+be+set'
          4        DO_FCALL                                      0          
          5      > THROW                                         0          $1
   55     6    >   INIT_METHOD_CALL                                         '_crawl'
          7        CHECK_FUNC_ARG                                           
          8        FETCH_OBJ_FUNC_ARG                               $3      'url'
          9        SEND_FUNC_ARG                                            $3
         10        CHECK_FUNC_ARG                                           
         11        FETCH_OBJ_FUNC_ARG                               $4      'depth'
         12        SEND_FUNC_ARG                                            $4
         13        DO_FCALL                                      0          
   56    14        FETCH_OBJ_R                                      ~6      'results'
         15      > RETURN                                                   ~6
   57    16*     > RETURN                                                   null

End of function crawl

Function _crawl:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 47) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 42, Position 2 = 60
Branch analysis from position: 42
2 jumps found. (Code = 78) Position 1 = 43, Position 2 = 60
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 54
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 60
Branch analysis from position: 20
filename:       /in/obfSR
function name:  _crawl
number of ops:  63
compiled vars:  !0 = $url, !1 = $depth, !2 = $seen, !3 = $dom, !4 = $anchors, !5 = $element, !6 = $href
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   59     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   61     2        BIND_STATIC                                              !2
   63     3        ISSET_ISEMPTY_CV                                         !0
          4      > JMPZ                                                     ~7, ->6
          5    > > RETURN                                                   null
   65     6    >   INIT_METHOD_CALL                                         'buildUrl'
          7        CHECK_FUNC_ARG                                           
          8        FETCH_OBJ_FUNC_ARG                               $8      'url'
          9        SEND_FUNC_ARG                                            $8
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0  $9      
         12        ASSIGN                                           ~10     !0, $9
         13        BOOL_NOT                                         ~11     ~10
         14      > JMPZ                                                     ~11, ->16
   66    15    > > RETURN                                                   null
   69    16    >   IS_IDENTICAL                                     ~12     !1, 0
         17      > JMPNZ_EX                                         ~12     ~12, ->20
         18    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~13     !2, !0
         19        BOOL                                             ~12     ~13
         20    > > JMPZ                                                     ~12, ->22
   70    21    > > RETURN                                                   null
   73    22    >   ASSIGN_DIM                                               !2, !0
         23        OP_DATA                                                  <true>
   75    24        NEW                                              $15     'DOMDocument'
         25        SEND_VAL_EX                                              '1.0'
         26        DO_FCALL                                      0          
         27        ASSIGN                                                   !3, $15
   76    28        BEGIN_SILENCE                                    ~18     
         29        INIT_METHOD_CALL                                         !3, 'loadHTMLFile'
         30        SEND_VAR_EX                                              !0
         31        DO_FCALL                                      0          
         32        END_SILENCE                                              ~18
   79    33        INIT_ARRAY                                       ~22     !0, 'url'
   78    34        FETCH_OBJ_W                                      $20     'results'
         35        ASSIGN_DIM                                               $20
   79    36        OP_DATA                                                  ~22
   83    37        INIT_METHOD_CALL                                         !3, 'getElementsByTagName'
         38        SEND_VAL_EX                                              'a'
         39        DO_FCALL                                      0  $23     
         40        ASSIGN                                                   !4, $23
   84    41      > FE_RESET_R                                       $25     !4, ->60
         42    > > FE_FETCH_R                                               $25, !5, ->60
   86    43    >   INIT_METHOD_CALL                                         'buildUrl'
         44        SEND_VAR_EX                                              !0
         45        INIT_METHOD_CALL                                         !5, 'getAttribute'
         46        SEND_VAL_EX                                              'href'
         47        DO_FCALL                                      0  $26     
         48        SEND_VAR_NO_REF_EX                                       $26
         49        DO_FCALL                                      0  $27     
         50        ASSIGN                                           ~28     !6, $27
         51        BOOL_NOT                                         ~29     ~28
         52      > JMPZ                                                     ~29, ->54
   87    53    > > JMP                                                      ->42
   89    54    >   INIT_METHOD_CALL                                         '_crawl'
         55        SEND_VAR                                                 !6
         56        SUB                                              ~30     !1, 1
         57        SEND_VAL                                                 ~30
         58        DO_FCALL                                      0          
   84    59      > JMP                                                      ->42
         60    >   FE_FREE                                                  $25
   92    61      > RETURN                                                   !0
   93    62*     > RETURN                                                   null

End of function _crawl

Function buildurl:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 96
Branch analysis from position: 8
2 jumps found. (Code = 47) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 42
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 46) Position 1 = 57, Position 2 = 60
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 95
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 84
Branch analysis from position: 68
2 jumps found. (Code = 46) Position 1 = 103, Position 2 = 109
Branch analysis from position: 103
2 jumps found. (Code = 43) Position 1 = 110, Position 2 = 111
Branch analysis from position: 110
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 111
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 109
Branch analysis from position: 84
Branch analysis from position: 95
Branch analysis from position: 60
Branch analysis from position: 42
2 jumps found. (Code = 46) Position 1 = 57, Position 2 = 60
Branch analysis from position: 57
Branch analysis from position: 60
Branch analysis from position: 20
Branch analysis from position: 96
filename:       /in/obfSR
function name:  buildUrl
number of ops:  113
compiled vars:  !0 = $url, !1 = $href, !2 = $path, !3 = $new_href, !4 = $parts, !5 = $path_parts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   95     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   97     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 'http'
          5        DO_ICALL                                         $6      
          6        IS_NOT_IDENTICAL                                         $6, 0
          7      > JMPZ                                                     ~7, ->96
   99     8    >   INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 'javascript%3A'
         11        DO_ICALL                                         $8      
         12        IS_IDENTICAL                                     ~9      $8, 0
         13      > JMPNZ_EX                                         ~9      ~9, ->20
         14    >   INIT_FCALL                                               'strpos'
         15        SEND_VAR                                                 !1
         16        SEND_VAL                                                 '%23'
         17        DO_ICALL                                         $10     
         18        IS_IDENTICAL                                     ~11     $10, 0
         19        BOOL                                             ~9      ~11
         20    > > JMPZ                                                     ~9, ->22
  101    21    > > RETURN                                                   <false>
  103    22    >   INIT_FCALL                                               'ltrim'
         23        SEND_VAR                                                 !1
         24        SEND_VAL                                                 '%2F'
         25        DO_ICALL                                         $12     
         26        CONCAT                                           ~13     '%2F', $12
         27        ASSIGN                                                   !2, ~13
  104    28        INIT_FCALL                                               'extension_loaded'
         29        SEND_VAL                                                 'http'
         30        DO_ICALL                                         $15     
         31      > JMPZ                                                     $15, ->42
  106    32    >   INIT_FCALL_BY_NAME                                       'http_build_url'
         33        SEND_VAR_EX                                              !0
         34        INIT_ARRAY                                       ~16     !2, 'path'
         35        SEND_VAL_EX                                              ~16
         36        FETCH_CONSTANT                                   ~17     'HTTP_URL_REPLACE'
         37        SEND_VAL_EX                                              ~17
         38        SEND_VAR_EX                                              !4
         39        DO_FCALL                                      0  $18     
         40        ASSIGN                                                   !3, $18
         41      > JMP                                                      ->51
  110    42    >   INIT_FCALL                                               'parse_url'
         43        SEND_VAR                                                 !0
         44        DO_ICALL                                         $20     
         45        ASSIGN                                                   !4, $20
  111    46        INIT_METHOD_CALL                                         'buildUrlFromParts'
         47        SEND_VAR_EX                                              !4
         48        DO_FCALL                                      0  $22     
         49        ASSIGN                                                   !3, $22
  112    50        ASSIGN_OP                                     8          !3, !2
  115    51    >   INIT_FCALL                                               'strpos'
         52        SEND_VAR                                                 !1
         53        SEND_VAL                                                 '.%2F'
         54        DO_ICALL                                         $25     
         55        IS_IDENTICAL                                     ~26     $25, 0
         56      > JMPZ_EX                                          ~26     ~26, ->60
         57    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~27     !4, 'path'
         58        BOOL_NOT                                         ~28     ~27
         59        BOOL                                             ~26     ~28
         60    > > JMPZ                                                     ~26, ->95
  118    61    >   INIT_FCALL                                               'preg_match'
         62        SEND_VAL                                                 '%40%2F%24%40'
         63        FETCH_DIM_R                                      ~29     !4, 'path'
         64        SEND_VAL                                                 ~29
         65        DO_ICALL                                         $30     
         66        BOOL_NOT                                         ~31     $30
         67      > JMPZ                                                     ~31, ->84
  119    68    >   INIT_FCALL                                               'explode'
         69        SEND_VAL                                                 '%2F'
         70        FETCH_DIM_R                                      ~32     !4, 'path'
         71        SEND_VAL                                                 ~32
         72        DO_ICALL                                         $33     
         73        ASSIGN                                                   !5, $33
  120    74        INIT_FCALL                                               'array_pop'
         75        SEND_REF                                                 !5
         76        DO_ICALL                                                 
  121    77        INIT_FCALL                                               'implode'
         78        SEND_VAL                                                 '%2F'
         79        SEND_VAR                                                 !5
         80        DO_ICALL                                         $37     
         81        CONCAT                                           ~38     $37, '%2F'
         82        ASSIGN_DIM                                               !4, 'path'
         83        OP_DATA                                                  ~38
  124    84    >   INIT_METHOD_CALL                                         'buildUrlFromParts'
         85        SEND_VAR_EX                                              !4
         86        DO_FCALL                                      0  $39     
         87        FETCH_DIM_R                                      ~40     !4, 'path'
         88        CONCAT                                           ~41     $39, ~40
         89        INIT_FCALL                                               'ltrim'
         90        SEND_VAR                                                 !1
         91        SEND_VAL                                                 '.%2F'
         92        DO_ICALL                                         $42     
         93        CONCAT                                           ~43     ~41, $42
         94        ASSIGN                                                   !3, ~43
  126    95    >   ASSIGN                                                   !1, !3
  128    96    >   INIT_FCALL                                               'rtrim'
         97        SEND_VAR                                                 !1
         98        SEND_VAL                                                 '%2F'
         99        DO_ICALL                                         $46     
        100        ASSIGN                                                   !1, $46
  129   101        FETCH_OBJ_R                                      ~48     'same_host'
        102      > JMPZ_EX                                          ~48     ~48, ->109
        103    >   FETCH_OBJ_R                                      ~49     'host'
        104        INIT_METHOD_CALL                                         'getHostFromUrl'
        105        SEND_VAR_EX                                              !1
        106        DO_FCALL                                      0  $50     
        107        IS_NOT_EQUAL                                     ~51     $50, ~49
        108        BOOL                                             ~48     ~51
        109    > > JMPZ                                                     ~48, ->111
  130   110    > > RETURN                                                   <false>
  132   111    > > RETURN                                                   !1
  133   112*     > RETURN                                                   null

End of function buildurl

Function buildurlfromparts:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 15
Branch analysis from position: 8
filename:       /in/obfSR
function name:  buildUrlFromParts
number of ops:  24
compiled vars:  !0 = $parts, !1 = $new_href
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  135     0  E >   RECV                                             !0      
  137     1        FETCH_DIM_R                                      ~2      !0, 'scheme'
          2        CONCAT                                           ~3      ~2, '%3A%2F%2F'
          3        ASSIGN                                                   !1, ~3
  138     4        ISSET_ISEMPTY_DIM_OBJ                         0  ~5      !0, 'user'
          5      > JMPZ_EX                                          ~5      ~5, ->8
          6    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !0, 'pass'
          7        BOOL                                             ~5      ~6
          8    > > JMPZ                                                     ~5, ->15
  139     9    >   FETCH_DIM_R                                      ~7      !0, 'user'
         10        CONCAT                                           ~8      ~7, '%3A'
         11        FETCH_DIM_R                                      ~9      !0, 'pass'
         12        CONCAT                                           ~10     ~8, ~9
         13        CONCAT                                           ~11     ~10, '%40'
         14        ASSIGN_OP                                     8          !1, ~11
  141    15    >   FETCH_DIM_R                                      ~13     !0, 'host'
         16        ASSIGN_OP                                     8          !1, ~13
  142    17        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'port'
         18      > JMPZ                                                     ~15, ->22
  143    19    >   FETCH_DIM_R                                      ~16     !0, 'port'
         20        CONCAT                                           ~17     '%3A', ~16
         21        ASSIGN_OP                                     8          !1, ~17
  145    22    > > RETURN                                                   !1
  146    23*     > RETURN                                                   null

End of function buildurlfromparts

Function gethostfromurl:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obfSR
function name:  getHostFromUrl
number of ops:  16
compiled vars:  !0 = $url, !1 = $parts, !2 = $host
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  148     0  E >   RECV                                             !0      
  150     1        INIT_FCALL                                               'parse_url'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
  151     5        INIT_FCALL                                               'preg_match'
          6        SEND_VAL                                                 '%40%28%5B%5E%2F.%5D%2B%29%5C.%28%5B%5E.%5D%7B2%2C6%7D%28%3F%3A%5C.%5B%5E.%5D%7B2%2C3%7D%29%3F%29%24%40'
          7        FETCH_DIM_R                                      ~5      !1, 'host'
          8        SEND_VAL                                                 ~5
          9        SEND_REF                                                 !2
         10        DO_ICALL                                                 
  152    11        INIT_FCALL                                               'array_shift'
         12        SEND_REF                                                 !2
         13        DO_ICALL                                         $7      
         14      > RETURN                                                   $7
  153    15*     > RETURN                                                   null

End of function gethostfromurl

End of class Crawler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
292.53 ms | 1424 KiB | 34 Q