3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new DOMDocument(); $xml->loadXML('<root><node/></root>'); $xpath = new DOMXpath($xml); $el = $xml->createElement("testnode", "some val"); $xml->appendChild($el); echo "<xmp>" . $xml->saveXML() . "</xmp>";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LQVgL
function name:  (null)
number of ops:  24
compiled vars:  !0 = $xml, !1 = $xpath, !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
    3     3        INIT_METHOD_CALL                                         !0, 'loadXML'
          4        SEND_VAL_EX                                              '%3Croot%3E%3Cnode%2F%3E%3C%2Froot%3E'
          5        DO_FCALL                                      0          
    4     6        NEW                                              $7      'DOMXpath'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
    5    10        INIT_METHOD_CALL                                         !0, 'createElement'
         11        SEND_VAL_EX                                              'testnode'
         12        SEND_VAL_EX                                              'some+val'
         13        DO_FCALL                                      0  $10     
         14        ASSIGN                                                   !2, $10
    6    15        INIT_METHOD_CALL                                         !0, 'appendChild'
         16        SEND_VAR_EX                                              !2
         17        DO_FCALL                                      0          
    7    18        INIT_METHOD_CALL                                         !0, 'saveXML'
         19        DO_FCALL                                      0  $13     
         20        CONCAT                                           ~14     '%3Cxmp%3E', $13
         21        CONCAT                                           ~15     ~14, '%3C%2Fxmp%3E'
         22        ECHO                                                     ~15
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.46 ms | 1393 KiB | 13 Q