3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new SimpleXMLElement('<xml xmlns="http://xml" xmlns:foo="http://foo" xmlns:bar="http://bar" />'); $foo = $xml->addChild('foo', null, 'http://foo'); $tag = $foo->addChild('bar', null, 'http://bar'); $foo->bar[0] = 'Hello World!'; $dom = dom_import_simplexml($xml)->ownerDocument; $dom->formatOutput = true; echo $dom->saveXML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W5n3d
function name:  (null)
number of ops:  30
compiled vars:  !0 = $xml, !1 = $foo, !2 = $tag, !3 = $dom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'SimpleXMLElement'
          1        SEND_VAL_EX                                              '%3Cxml+xmlns%3D%22http%3A%2F%2Fxml%22+xmlns%3Afoo%3D%22http%3A%2F%2Ffoo%22+xmlns%3Abar%3D%22http%3A%2F%2Fbar%22+%2F%3E'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    5     4        INIT_METHOD_CALL                                         !0, 'addChild'
          5        SEND_VAL_EX                                              'foo'
          6        SEND_VAL_EX                                              null
          7        SEND_VAL_EX                                              'http%3A%2F%2Ffoo'
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
    7    10        INIT_METHOD_CALL                                         !1, 'addChild'
         11        SEND_VAL_EX                                              'bar'
         12        SEND_VAL_EX                                              null
         13        SEND_VAL_EX                                              'http%3A%2F%2Fbar'
         14        DO_FCALL                                      0  $9      
         15        ASSIGN                                                   !2, $9
    8    16        FETCH_OBJ_W                                      $11     !1, 'bar'
         17        ASSIGN_DIM                                               $11, 0
         18        OP_DATA                                                  'Hello+World%21'
   10    19        INIT_FCALL                                               'dom_import_simplexml'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $13     
         22        FETCH_OBJ_R                                      ~14     $13, 'ownerDocument'
         23        ASSIGN                                                   !3, ~14
   11    24        ASSIGN_OBJ                                               !3, 'formatOutput'
         25        OP_DATA                                                  <true>
   13    26        INIT_METHOD_CALL                                         !3, 'saveXML'
         27        DO_FCALL                                      0  $17     
         28        ECHO                                                     $17
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.32 ms | 1396 KiB | 15 Q