3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Access-Control-Allow-Origin: *'); $html = "http://www.margonem.pl/?task=clanrank&w=infinity"; $xml = new DOMDocument(); $xml->validateOnParse = true; $xml->loadHTML(file_get_contents($html)); $xpath = new DOMXPath($xml); $table =$xpath->query("//*[@id='ranking']")->item(0); $rows = $table->getElementsByTagName("tr"); foreach ($rows as $row) { $cells = $row -> getElementsByTagName('td'); foreach ($cells as $cell) { print $cell->nodeValue; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 43
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 43
Branch analysis from position: 32
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 41
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 41
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 41
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/5Sra2
function name:  (null)
number of ops:  45
compiled vars:  !0 = $html, !1 = $xml, !2 = $xpath, !3 = $table, !4 = $rows, !5 = $row, !6 = $cells, !7 = $cell
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'Access-Control-Allow-Origin%3A+%2A'
          2        DO_ICALL                                                 
    3     3        ASSIGN                                                   !0, 'http%3A%2F%2Fwww.margonem.pl%2F%3Ftask%3Dclanrank%26w%3Dinfinity'
    4     4        NEW                                              $10     'DOMDocument'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $10
    5     7        ASSIGN_OBJ                                               !1, 'validateOnParse'
          8        OP_DATA                                                  <true>
    6     9        INIT_METHOD_CALL                                         !1, 'loadHTML'
         10        INIT_FCALL                                               'file_get_contents'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $14     
         13        SEND_VAR_NO_REF_EX                                       $14
         14        DO_FCALL                                      0          
    7    15        NEW                                              $16     'DOMXPath'
         16        SEND_VAR_EX                                              !1
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !2, $16
    8    19        INIT_METHOD_CALL                                         !2, 'query'
         20        SEND_VAL_EX                                              '%2F%2F%2A%5B%40id%3D%27ranking%27%5D'
         21        DO_FCALL                                      0  $19     
         22        INIT_METHOD_CALL                                         $19, 'item'
         23        SEND_VAL_EX                                              0
         24        DO_FCALL                                      0  $20     
         25        ASSIGN                                                   !3, $20
    9    26        INIT_METHOD_CALL                                         !3, 'getElementsByTagName'
         27        SEND_VAL_EX                                              'tr'
         28        DO_FCALL                                      0  $22     
         29        ASSIGN                                                   !4, $22
   10    30      > FE_RESET_R                                       $24     !4, ->43
         31    > > FE_FETCH_R                                               $24, !5, ->43
   11    32    >   INIT_METHOD_CALL                                         !5, 'getElementsByTagName'
         33        SEND_VAL_EX                                              'td'
         34        DO_FCALL                                      0  $25     
         35        ASSIGN                                                   !6, $25
   12    36      > FE_RESET_R                                       $27     !6, ->41
         37    > > FE_FETCH_R                                               $27, !7, ->41
   13    38    >   FETCH_OBJ_R                                      ~28     !7, 'nodeValue'
         39        ECHO                                                     ~28
   12    40      > JMP                                                      ->37
         41    >   FE_FREE                                                  $27
   10    42      > JMP                                                      ->31
         43    >   FE_FREE                                                  $24
   15    44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.77 ms | 1400 KiB | 17 Q