3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<root> <parent> <child name='Child1' /> <child name='Child2' /> <subparent> <child name='Child3' /> </subparent> </parent> <child name='Child4' /> </root>"; $dom=DOMDocument(); $dom->loadXML($xml); $val=$dom->getElementsByTagName('root')->item(0); print_r($val);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6m8RY
function name:  (null)
number of ops:  18
compiled vars:  !0 = $xml, !1 = $dom, !2 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Croot%3E%0A++++%3Cparent%3E%0A++++++++%3Cchild+name%3D%27Child1%27+%2F%3E%0A++++++++%3Cchild+name%3D%27Child2%27+%2F%3E%0A++++++++%3Csubparent%3E%0A++++++++++++%3Cchild+name%3D%27Child3%27+%2F%3E%0A++++++++%3C%2Fsubparent%3E%0A++++%3C%2Fparent%3E%0A++++%3Cchild+name%3D%27Child4%27+%2F%3E%0A%3C%2Froot%3E'
   13     1        INIT_FCALL_BY_NAME                                       'DOMDocument'
          2        DO_FCALL                                      0  $4      
          3        ASSIGN                                                   !1, $4
   14     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   15     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'root'
          9        DO_FCALL                                      0  $7      
         10        INIT_METHOD_CALL                                         $7, 'item'
         11        SEND_VAL_EX                                              0
         12        DO_FCALL                                      0  $8      
         13        ASSIGN                                                   !2, $8
   16    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.59 ms | 1395 KiB | 15 Q