3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new DOMDocument(); //$xml->loadXML('<root><node/></root>'); $root = $xml->createElement("root"); $xml->appendChild($root); //$xpath = new DOMXpath($xml); $el = $xml->createElement("testnode", "some val"); $root->appendChild($el); $xml->formatOutput = true; echo $xml->saveXML(); //$entries = $xpath->query("/testnode");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oCvv4
function name:  (null)
number of ops:  24
compiled vars:  !0 = $xml, !1 = $root, !2 = $el
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    4     3        INIT_METHOD_CALL                                         !0, 'createElement'
          4        SEND_VAL_EX                                              'root'
          5        DO_FCALL                                      0  $6      
          6        ASSIGN                                                   !1, $6
    5     7        INIT_METHOD_CALL                                         !0, 'appendChild'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
    7    10        INIT_METHOD_CALL                                         !0, 'createElement'
         11        SEND_VAL_EX                                              'testnode'
         12        SEND_VAL_EX                                              'some+val'
         13        DO_FCALL                                      0  $9      
         14        ASSIGN                                                   !2, $9
    8    15        INIT_METHOD_CALL                                         !1, 'appendChild'
         16        SEND_VAR_EX                                              !2
         17        DO_FCALL                                      0          
    9    18        ASSIGN_OBJ                                               !0, 'formatOutput'
         19        OP_DATA                                                  <true>
   10    20        INIT_METHOD_CALL                                         !0, 'saveXML'
         21        DO_FCALL                                      0  $13     
         22        ECHO                                                     $13
   11    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.73 ms | 1394 KiB | 13 Q