3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlStr = '<root><node> <child1></child1> <findme>first</findme> <child2></child2> </node> <node> <child1> <findme>second</findme> </child1> <child2></child2> </node> <node> <child1></child1> <child2> <another> <findme>third</findme> </another> </child2> </node></root>'; $dom = new DOMDocument(); $dom->LoadXML($xmlStr); $nodes = $dom->getElementsByTagName('node'); foreach($nodes as $node) { $findme = $node->getElementsByTagName("findme")->item(0); echo $findme->textContent."\r"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 24
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 24
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/aEEu9
function name:  (null)
number of ops:  26
compiled vars:  !0 = $xmlStr, !1 = $dom, !2 = $nodes, !3 = $node, !4 = $findme
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Croot%3E%3Cnode%3E%0A++++%3Cchild1%3E%3C%2Fchild1%3E%0A++++%3Cfindme%3Efirst%3C%2Ffindme%3E%0A++++%3Cchild2%3E%3C%2Fchild2%3E%0A%3C%2Fnode%3E%0A%3Cnode%3E%0A++++%3Cchild1%3E%0A++++++++%3Cfindme%3Esecond%3C%2Ffindme%3E%0A++++%3C%2Fchild1%3E%0A++++%3Cchild2%3E%3C%2Fchild2%3E%0A%3C%2Fnode%3E%0A%3Cnode%3E%0A++++%3Cchild1%3E%3C%2Fchild1%3E%0A++++%3Cchild2%3E%0A++++++%3Canother%3E%0A++++++++++++%3Cfindme%3Ethird%3C%2Ffindme%3E%0A++++++%3C%2Fanother%3E%0A++++%3C%2Fchild2%3E%0A%3C%2Fnode%3E%3C%2Froot%3E'
   22     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
   23     4        INIT_METHOD_CALL                                         !1, 'LoadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   24     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'node'
          9        DO_FCALL                                      0  $10     
         10        ASSIGN                                                   !2, $10
   26    11      > FE_RESET_R                                       $12     !2, ->24
         12    > > FE_FETCH_R                                               $12, !3, ->24
   28    13    >   INIT_METHOD_CALL                                         !3, 'getElementsByTagName'
         14        SEND_VAL_EX                                              'findme'
         15        DO_FCALL                                      0  $13     
         16        INIT_METHOD_CALL                                         $13, 'item'
         17        SEND_VAL_EX                                              0
         18        DO_FCALL                                      0  $14     
         19        ASSIGN                                                   !4, $14
   29    20        FETCH_OBJ_R                                      ~16     !4, 'textContent'
         21        CONCAT                                           ~17     ~16, '%0D'
         22        ECHO                                                     ~17
   26    23      > JMP                                                      ->12
         24    >   FE_FREE                                                  $12
   32    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.27 ms | 1435 KiB | 13 Q