3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = file_get_contents('http://www.amazon.com/Now-Foods-Vitamin-100mcg-Liposomal/dp/B0045MJNCU'); //get the html returned from the following url $pokemon_doc = new DOMDocument(); libxml_use_internal_errors(TRUE); //disable libxml errors if(!empty($html)){ //if any html is actually returned $pokemon_doc->loadHTML($html); libxml_clear_errors(); //remove errors for yucky html $pokemon_xpath = new DOMXPath($pokemon_doc); //get all the h2's with an id $pokemon_row = $pokemon_xpath->query('//*[@id="price"]/table/tbody/tr[1]'); if($pokemon_row->length > 0){ foreach($pokemon_row as $row){ echo $row->nodeValue . "<br/>"; } } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 36
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 36
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 35
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 35
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 36
Branch analysis from position: 36
filename:       /in/Vh2HA
function name:  (null)
number of ops:  37
compiled vars:  !0 = $html, !1 = $pokemon_doc, !2 = $pokemon_xpath, !3 = $pokemon_row, !4 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'file_get_contents'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.amazon.com%2FNow-Foods-Vitamin-100mcg-Liposomal%2Fdp%2FB0045MJNCU'
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    4     4        NEW                                              $7      'DOMDocument'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $7
    6     7        INIT_FCALL                                               'libxml_use_internal_errors'
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                                 
    8    10        ISSET_ISEMPTY_CV                                 ~11     !0
         11        BOOL_NOT                                         ~12     ~11
         12      > JMPZ                                                     ~12, ->36
   10    13    >   INIT_METHOD_CALL                                         !1, 'loadHTML'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0          
   11    16        INIT_FCALL                                               'libxml_clear_errors'
         17        DO_ICALL                                                 
   13    18        NEW                                              $15     'DOMXPath'
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !2, $15
   16    22        INIT_METHOD_CALL                                         !2, 'query'
         23        SEND_VAL_EX                                              '%2F%2F%2A%5B%40id%3D%22price%22%5D%2Ftable%2Ftbody%2Ftr%5B1%5D'
         24        DO_FCALL                                      0  $18     
         25        ASSIGN                                                   !3, $18
   18    26        FETCH_OBJ_R                                      ~20     !3, 'length'
         27        IS_SMALLER                                               0, ~20
         28      > JMPZ                                                     ~21, ->36
   19    29    > > FE_RESET_R                                       $22     !3, ->35
         30    > > FE_FETCH_R                                               $22, !4, ->35
   20    31    >   FETCH_OBJ_R                                      ~23     !4, 'nodeValue'
         32        CONCAT                                           ~24     ~23, '%3Cbr%2F%3E'
         33        ECHO                                                     ~24
   19    34      > JMP                                                      ->30
         35    >   FE_FREE                                                  $22
   24    36    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.93 ms | 1392 KiB | 19 Q