3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<'EOT' <data> <categories categories_name="Toners"> <childs> <categories categories_name="Ex ample"/> </childs> </categories> </data> EOT; $doc = new DOMDocument(); $doc->loadXML($xml); $xpath = new DOMXPath($doc); foreach($xpath->query('//categories[@categories_name="Toners"]/childs/categories[@categories_name="Ex ample"]') as $node) { var_dump($node); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/FPRFR
function name:  (null)
number of ops:  22
compiled vars:  !0 = $xml, !1 = $doc, !2 = $xpath, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cdata%3E%0A++++%3Ccategories+categories_name%3D%22Toners%22%3E%0A++++++++%3Cchilds%3E%0A++++++++++++%3Ccategories+categories_name%3D%22Ex+ample%22%2F%3E%0A++++++++%3C%2Fchilds%3E%0A++++%3C%2Fcategories%3E%0A%3C%2Fdata%3E'
   12     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   13     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   15     7        NEW                                              $9      'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $9
   16    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2F%2Fcategories%5B%40categories_name%3D%22Toners%22%5D%2Fchilds%2Fcategories%5B%40categories_name%3D%22Ex+ample%22%5D'
         13        DO_FCALL                                      0  $12     
         14      > FE_RESET_R                                       $13     $12, ->20
         15    > > FE_FETCH_R                                               $13, !3, ->20
   18    16    >   INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                                 
   16    19      > JMP                                                      ->15
         20    >   FE_FREE                                                  $13
   19    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.07 ms | 1395 KiB | 15 Q