3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "http://store.steampowered.com/app/100"; $dom = new domDocument; libxml_use_internal_errors(true); $dom->loadHTMLFile($url); $classname="game_description_snippet"; $finder = new DomXPath($dom); $spaner = $finder->query("//*[contains(@class, '$classname')]"); foreach ($spaner as $spane) { //This part returns: Fatal error: Call to undefined method DOMElement::item() $mo = $spane->item(0)->nodeValue; echo $mo; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 31
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 31
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/EeYPe
function name:  (null)
number of ops:  33
compiled vars:  !0 = $url, !1 = $dom, !2 = $classname, !3 = $finder, !4 = $spaner, !5 = $spane, !6 = $mo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fstore.steampowered.com%2Fapp%2F100'
    5     1        NEW                                              $8      'domDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $8
    6     4        INIT_FCALL                                               'libxml_use_internal_errors'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                                 
    7     7        INIT_METHOD_CALL                                         !1, 'loadHTMLFile'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
    9    10        ASSIGN                                                   !2, 'game_description_snippet'
   10    11        NEW                                              $14     'DomXPath'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !3, $14
   11    15        INIT_METHOD_CALL                                         !3, 'query'
         16        ROPE_INIT                                     3  ~18     '%2F%2F%2A%5Bcontains%28%40class%2C+%27'
         17        ROPE_ADD                                      1  ~18     ~18, !2
         18        ROPE_END                                      2  ~17     ~18, '%27%29%5D'
         19        SEND_VAL_EX                                              ~17
         20        DO_FCALL                                      0  $20     
         21        ASSIGN                                                   !4, $20
   13    22      > FE_RESET_R                                       $22     !4, ->31
         23    > > FE_FETCH_R                                               $22, !5, ->31
   14    24    >   INIT_METHOD_CALL                                         !5, 'item'
         25        SEND_VAL_EX                                              0
         26        DO_FCALL                                      0  $23     
         27        FETCH_OBJ_R                                      ~24     $23, 'nodeValue'
         28        ASSIGN                                                   !6, ~24
   15    29        ECHO                                                     !6
   13    30      > JMP                                                      ->23
         31    >   FE_FREE                                                  $22
   18    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.89 ms | 1396 KiB | 15 Q