3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<'XML' <root xmlns:ns1="foo" xmlns:ns2="bar"/> XML; $dom = new DOMDocument(); $dom->loadXML($xml); $xpath = new DOMXPath($dom); $namespaces = $xpath->query('//namespace::*'); var_dump($namespaces instanceof DOMNodeList); foreach ($namespaces as $ns) { var_dump($ns instanceof DOMNode); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/9Ks2b
function name:  (null)
number of ops:  28
compiled vars:  !0 = $xml, !1 = $dom, !2 = $xpath, !3 = $namespaces, !4 = $ns
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Croot+xmlns%3Ans1%3D%22foo%22+xmlns%3Ans2%3D%22bar%22%2F%3E'
    7     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
    8     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    9     7        NEW                                              $10     'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $10
   11    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2F%2Fnamespace%3A%3A%2A'
         13        DO_FCALL                                      0  $13     
         14        ASSIGN                                                   !3, $13
   13    15        INIT_FCALL                                               'var_dump'
         16        INSTANCEOF                                       ~15     !3, 'DOMNodeList'
         17        SEND_VAL                                                 ~15
         18        DO_ICALL                                                 
   15    19      > FE_RESET_R                                       $17     !3, ->26
         20    > > FE_FETCH_R                                               $17, !4, ->26
   16    21    >   INIT_FCALL                                               'var_dump'
         22        INSTANCEOF                                       ~18     !4, 'DOMNode'
         23        SEND_VAL                                                 ~18
         24        DO_ICALL                                                 
   15    25      > JMP                                                      ->20
         26    >   FE_FREE                                                  $17
   17    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.93 ms | 1407 KiB | 15 Q