3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<'EOX' <foo> <bar attr="quux" /> </foo> EOX; $dom = new DOMDocument; $dom->loadXML($xml); $xp = new DOMXPath($dom); var_dump($xp->query('//bar/@attr')); var_dump($xp->query('//bar/@attr')->item(0));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NAJlv
function name:  (null)
number of ops:  27
compiled vars:  !0 = $xml, !1 = $dom, !2 = $xp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cfoo%3E%0A++%3Cbar+attr%3D%22quux%22+%2F%3E%0A%3C%2Ffoo%3E'
    9     1        NEW                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   10     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   11     7        NEW                                              $8      'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $8
   12    11        INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !2, 'query'
         13        SEND_VAL_EX                                              '%2F%2Fbar%2F%40attr'
         14        DO_FCALL                                      0  $11     
         15        SEND_VAR                                                 $11
         16        DO_ICALL                                                 
   13    17        INIT_FCALL                                               'var_dump'
         18        INIT_METHOD_CALL                                         !2, 'query'
         19        SEND_VAL_EX                                              '%2F%2Fbar%2F%40attr'
         20        DO_FCALL                                      0  $13     
         21        INIT_METHOD_CALL                                         $13, 'item'
         22        SEND_VAL_EX                                              0
         23        DO_FCALL                                      0  $14     
         24        SEND_VAR                                                 $14
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.26 ms | 1395 KiB | 15 Q