3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = "http://en.wikipedia.org/wiki/Foobar"; $dom = new DOMDocument(); $dom->loadHTML($html); $xpath = new DOMXPath($dom); $divContent = $xpath->query('//div[id="toc"]'); var_dump( $divContent->value);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KmvZO
function name:  (null)
number of ops:  20
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath, !3 = $divContent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FFoobar'
    4     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    6     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    8     7        NEW                                              $9      'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $9
    9    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2F%2Fdiv%5Bid%3D%22toc%22%5D'
         13        DO_FCALL                                      0  $12     
         14        ASSIGN                                                   !3, $12
   11    15        INIT_FCALL                                               'var_dump'
         16        FETCH_OBJ_R                                      ~14     !3, 'value'
         17        SEND_VAL                                                 ~14
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.23 ms | 1395 KiB | 15 Q