3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0"?> <root> <foo /> <bar> <qux /> </bar> </root> XML; $dom = new DOMDocument(); $dom->loadXML($xml); $query = '/root'; $xpath = new DOMXpath($dom); var_dump($xpath->query($query));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YX2g3
function name:  (null)
number of ops:  19
compiled vars:  !0 = $xml, !1 = $dom, !2 = $query, !3 = $xpath
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Croot%3E%0A%09%3Cfoo+%2F%3E%0A%09%3Cbar%3E%0A%09%09%3Cqux+%2F%3E%0A%09%3C%2Fbar%3E%0A%3C%2Froot%3E'
   14     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   15     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   17     7        ASSIGN                                                   !2, '%2Froot'
   18     8        NEW                                              $10     'DOMXpath'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !3, $10
   19    12        INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !3, 'query'
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0  $13     
         16        SEND_VAR                                                 $13
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.16 ms | 1395 KiB | 15 Q