3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <root xmlns:test="http://www.w3.org/2001/XMLSchema" xmlns:user="http://www.w3.org/2001/XMLSchema"> <user:name test:one = "firstUser" /> <name second = "secondUser" /> </root>'; $doc = new DOMDocument(); $doc->loadXML($xml); $root = $doc->getElementsByTagName("root"); echo "<pre>"; foreach ($doc->getElementsByTagName('name') as $users) { echo $users->nodeName.":"; foreach ($users->attributes as $attr) { echo $attr->name." ".$attr->value."<br>"; } echo "<br>"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 33
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 33
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 30
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 30
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/ZfUR3
function name:  (null)
number of ops:  35
compiled vars:  !0 = $xml, !1 = $doc, !2 = $root, !3 = $users, !4 = $attr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Croot+xmlns%3Atest%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22++xmlns%3Auser%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22%3E%0A++++%3Cuser%3Aname+test%3Aone+%3D+%22firstUser%22+%2F%3E%0A++++%3Cname+second+%3D+%22secondUser%22+%2F%3E%0A%3C%2Froot%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        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'root'
          9        DO_FCALL                                      0  $10     
         10        ASSIGN                                                   !2, $10
   10    11        ECHO                                                     '%3Cpre%3E'
   11    12        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
         13        SEND_VAL_EX                                              'name'
         14        DO_FCALL                                      0  $12     
         15      > FE_RESET_R                                       $13     $12, ->33
         16    > > FE_FETCH_R                                               $13, !3, ->33
   12    17    >   FETCH_OBJ_R                                      ~14     !3, 'nodeName'
         18        CONCAT                                           ~15     ~14, '%3A'
         19        ECHO                                                     ~15
   13    20        FETCH_OBJ_R                                      ~16     !3, 'attributes'
         21      > FE_RESET_R                                       $17     ~16, ->30
         22    > > FE_FETCH_R                                               $17, !4, ->30
   14    23    >   FETCH_OBJ_R                                      ~18     !4, 'name'
         24        CONCAT                                           ~19     ~18, '+'
         25        FETCH_OBJ_R                                      ~20     !4, 'value'
         26        CONCAT                                           ~21     ~19, ~20
         27        CONCAT                                           ~22     ~21, '%3Cbr%3E'
         28        ECHO                                                     ~22
   13    29      > JMP                                                      ->22
         30    >   FE_FREE                                                  $17
   16    31        ECHO                                                     '%3Cbr%3E'
   11    32      > JMP                                                      ->16
         33    >   FE_FREE                                                  $13
   17    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.98 ms | 1004 KiB | 13 Q