3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* I somehow want this part..: $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIE, "birthtime=28801; path=/; domain=store.steampowered.com"); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); *///To be sent with the DomXPath part, so the DOM fetches the site with the cookie placed to avoid age restriction - // - blocking it from fetching the description. // Need I execute the DOM using $result (tried that, failed miserably), or is there another way? $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) { $spanx = $spane->childNodes; $description = $spanx->item(0)->nodeValue; $GLOBALS['x'] = $description; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 35
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 35
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/Yhnln
function name:  (null)
number of ops:  37
compiled vars:  !0 = $url, !1 = $dom, !2 = $classname, !3 = $finder, !4 = $spaner, !5 = $spane, !6 = $spanx, !7 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fstore.steampowered.com%2Fapp%2F100'
   18     1        NEW                                              $9      'domDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $9
   19     4        INIT_FCALL                                               'libxml_use_internal_errors'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                                 
   20     7        INIT_METHOD_CALL                                         !1, 'loadHTMLFile'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   22    10        ASSIGN                                                   !2, 'game_description_snippet'
   23    11        NEW                                              $15     'DomXPath'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !3, $15
   24    15        INIT_METHOD_CALL                                         !3, 'query'
         16        ROPE_INIT                                     3  ~19     '%2F%2F%2A%5Bcontains%28%40class%2C+%27'
         17        ROPE_ADD                                      1  ~19     ~19, !2
         18        ROPE_END                                      2  ~18     ~19, '%27%29%5D'
         19        SEND_VAL_EX                                              ~18
         20        DO_FCALL                                      0  $21     
         21        ASSIGN                                                   !4, $21
   26    22      > FE_RESET_R                                       $23     !4, ->35
         23    > > FE_FETCH_R                                               $23, !5, ->35
   27    24    >   FETCH_OBJ_R                                      ~24     !5, 'childNodes'
         25        ASSIGN                                                   !6, ~24
   28    26        INIT_METHOD_CALL                                         !6, 'item'
         27        SEND_VAL_EX                                              0
         28        DO_FCALL                                      0  $26     
         29        FETCH_OBJ_R                                      ~27     $26, 'nodeValue'
         30        ASSIGN                                                   !7, ~27
   29    31        FETCH_W                      global              $29     'GLOBALS'
         32        ASSIGN_DIM                                               $29, 'x'
         33        OP_DATA                                                  !7
   26    34      > JMP                                                      ->23
         35    >   FE_FREE                                                  $23
   32    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.16 ms | 1401 KiB | 15 Q