3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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 = 28, Position 2 = 40
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 40
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 34, Position 2 = 38
Branch analysis from position: 34
2 jumps found. (Code = 78) Position 1 = 35, Position 2 = 38
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 38
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/7CdhG
function name:  (null)
number of ops:  42
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 >   ASSIGN                                                   !0, 'http%3A%2F%2Fwww.margonem.pl%2F%3Ftask%3Dclanrank%26w%3Dinfinity'
    3     1        NEW                                              $9      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $9
    4     4        ASSIGN_OBJ                                               !1, 'validateOnParse'
          5        OP_DATA                                                  <true>
    5     6        INIT_METHOD_CALL                                         !1, 'loadHTML'
          7        INIT_FCALL                                               'file_get_contents'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $13     
         10        SEND_VAR_NO_REF_EX                                       $13
         11        DO_FCALL                                      0          
    6    12        NEW                                              $15     'DOMXPath'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !2, $15
    7    16        INIT_METHOD_CALL                                         !2, 'query'
         17        SEND_VAL_EX                                              '%2F%2F%2A%5B%40id%3D%27ranking%27%5D'
         18        DO_FCALL                                      0  $18     
         19        INIT_METHOD_CALL                                         $18, 'item'
         20        SEND_VAL_EX                                              0
         21        DO_FCALL                                      0  $19     
         22        ASSIGN                                                   !3, $19
    8    23        INIT_METHOD_CALL                                         !3, 'getElementsByTagName'
         24        SEND_VAL_EX                                              'tr'
         25        DO_FCALL                                      0  $21     
         26        ASSIGN                                                   !4, $21
    9    27      > FE_RESET_R                                       $23     !4, ->40
         28    > > FE_FETCH_R                                               $23, !5, ->40
   10    29    >   INIT_METHOD_CALL                                         !5, 'getElementsByTagName'
         30        SEND_VAL_EX                                              'td'
         31        DO_FCALL                                      0  $24     
         32        ASSIGN                                                   !6, $24
   11    33      > FE_RESET_R                                       $26     !6, ->38
         34    > > FE_FETCH_R                                               $26, !7, ->38
   12    35    >   FETCH_OBJ_R                                      ~27     !7, 'nodeValue'
         36        ECHO                                                     ~27
   11    37      > JMP                                                      ->34
         38    >   FE_FREE                                                  $26
    9    39      > JMP                                                      ->28
         40    >   FE_FREE                                                  $23
   14    41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.88 ms | 1400 KiB | 15 Q