3v4l.org

run code in 300+ PHP versions simultaneously
<?php // "Create" the document. $xml = new DOMDocument( "1.0", "ISO-8859-15" ); $xml->xmlVersion = null; $xml->standalone = true; $xml->doctype = null; // Create some elements. $xml_album = $xml->createElement( "Album" ); $xml_track = $xml->createElement( "Track", "The ninth symphony" ); // Set the attributes. $xml_track->setAttribute( "length", "0:01:15" ); $xml_track->setAttribute( "bitrate", "64kb/s" ); $xml_track->setAttribute( "channels", "2" ); // Create another element, just to show you can add any (realistic to computer) number of sublevels. $xml_note = $xml->createElement( "Note", "The last symphony composed by Ludwig van Beethoven." ); // Append the whole bunch. $xml_track->appendChild( $xml_note ); $xml_album->appendChild( $xml_track ); // Repeat the above with some different values.. $xml_track = $xml->createElement( "Track", "Highway Blues" ); $xml_track->setAttribute( "length", "0:01:33" ); $xml_track->setAttribute( "bitrate", "64kb/s" ); $xml_track->setAttribute( "channels", "2" ); $xml_album->appendChild( $xml_track ); $xml->appendChild( $xml_album ); // Parse the XML. print $xml->saveXML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rr1vI
function name:  (null)
number of ops:  70
compiled vars:  !0 = $xml, !1 = $xml_album, !2 = $xml_track, !3 = $xml_note
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $4      'DOMDocument'
          1        SEND_VAL_EX                                              '1.0'
          2        SEND_VAL_EX                                              'ISO-8859-15'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $4
    6     5        ASSIGN_OBJ                                               !0, 'xmlVersion'
          6        OP_DATA                                                  null
    7     7        ASSIGN_OBJ                                               !0, 'standalone'
          8        OP_DATA                                                  <true>
    8     9        ASSIGN_OBJ                                               !0, 'doctype'
         10        OP_DATA                                                  null
   11    11        INIT_METHOD_CALL                                         !0, 'createElement'
         12        SEND_VAL_EX                                              'Album'
         13        DO_FCALL                                      0  $10     
         14        ASSIGN                                                   !1, $10
   12    15        INIT_METHOD_CALL                                         !0, 'createElement'
         16        SEND_VAL_EX                                              'Track'
         17        SEND_VAL_EX                                              'The+ninth+symphony'
         18        DO_FCALL                                      0  $12     
         19        ASSIGN                                                   !2, $12
   15    20        INIT_METHOD_CALL                                         !2, 'setAttribute'
         21        SEND_VAL_EX                                              'length'
         22        SEND_VAL_EX                                              '0%3A01%3A15'
         23        DO_FCALL                                      0          
   16    24        INIT_METHOD_CALL                                         !2, 'setAttribute'
         25        SEND_VAL_EX                                              'bitrate'
         26        SEND_VAL_EX                                              '64kb%2Fs'
         27        DO_FCALL                                      0          
   17    28        INIT_METHOD_CALL                                         !2, 'setAttribute'
         29        SEND_VAL_EX                                              'channels'
         30        SEND_VAL_EX                                              '2'
         31        DO_FCALL                                      0          
   20    32        INIT_METHOD_CALL                                         !0, 'createElement'
         33        SEND_VAL_EX                                              'Note'
         34        SEND_VAL_EX                                              'The+last+symphony+composed+by+Ludwig+van+Beethoven.'
         35        DO_FCALL                                      0  $17     
         36        ASSIGN                                                   !3, $17
   23    37        INIT_METHOD_CALL                                         !2, 'appendChild'
         38        SEND_VAR_EX                                              !3
         39        DO_FCALL                                      0          
   24    40        INIT_METHOD_CALL                                         !1, 'appendChild'
         41        SEND_VAR_EX                                              !2
         42        DO_FCALL                                      0          
   27    43        INIT_METHOD_CALL                                         !0, 'createElement'
         44        SEND_VAL_EX                                              'Track'
         45        SEND_VAL_EX                                              'Highway+Blues'
         46        DO_FCALL                                      0  $21     
         47        ASSIGN                                                   !2, $21
   29    48        INIT_METHOD_CALL                                         !2, 'setAttribute'
         49        SEND_VAL_EX                                              'length'
         50        SEND_VAL_EX                                              '0%3A01%3A33'
         51        DO_FCALL                                      0          
   30    52        INIT_METHOD_CALL                                         !2, 'setAttribute'
         53        SEND_VAL_EX                                              'bitrate'
         54        SEND_VAL_EX                                              '64kb%2Fs'
         55        DO_FCALL                                      0          
   31    56        INIT_METHOD_CALL                                         !2, 'setAttribute'
         57        SEND_VAL_EX                                              'channels'
         58        SEND_VAL_EX                                              '2'
         59        DO_FCALL                                      0          
   32    60        INIT_METHOD_CALL                                         !1, 'appendChild'
         61        SEND_VAR_EX                                              !2
         62        DO_FCALL                                      0          
   34    63        INIT_METHOD_CALL                                         !0, 'appendChild'
         64        SEND_VAR_EX                                              !1
         65        DO_FCALL                                      0          
   37    66        INIT_METHOD_CALL                                         !0, 'saveXML'
         67        DO_FCALL                                      0  $28     
         68        ECHO                                                     $28
         69      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.43 ms | 1390 KiB | 13 Q