3v4l.org

run code in 300+ PHP versions simultaneously
<?php // "Create" the document. $xml = new DOMDocument( "1.0", "ISO-8859-15" ); //to have indented output, not just a line $xml->preserveWhiteSpace = false; $xml->formatOutput = true; // ------------- Interresting part here ------------ //creating an xslt adding processing line $xslt = $xml->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="base.xsl"'); //adding it to the xml $xml->appendChild($xslt); // ----------- / Interresting part here ------------- //adding some elements $root = $xml->createElement("list"); $node = $xml->createElement("contact", "John Doe"); $root-> appendChild($node); $xml-> appendChild($root); //creating the file $xml-> save("output.xml"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3es0t
function name:  (null)
number of ops:  36
compiled vars:  !0 = $xml, !1 = $xslt, !2 = $root, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     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
    7     5        ASSIGN_OBJ                                               !0, 'preserveWhiteSpace'
          6        OP_DATA                                                  <false>
    8     7        ASSIGN_OBJ                                               !0, 'formatOutput'
          8        OP_DATA                                                  <true>
   13     9        INIT_METHOD_CALL                                         !0, 'createProcessingInstruction'
         10        SEND_VAL_EX                                              'xml-stylesheet'
         11        SEND_VAL_EX                                              'type%3D%22text%2Fxsl%22+href%3D%22base.xsl%22'
         12        DO_FCALL                                      0  $9      
         13        ASSIGN                                                   !1, $9
   16    14        INIT_METHOD_CALL                                         !0, 'appendChild'
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0          
   21    17        INIT_METHOD_CALL                                         !0, 'createElement'
         18        SEND_VAL_EX                                              'list'
         19        DO_FCALL                                      0  $12     
         20        ASSIGN                                                   !2, $12
   22    21        INIT_METHOD_CALL                                         !0, 'createElement'
         22        SEND_VAL_EX                                              'contact'
         23        SEND_VAL_EX                                              'John+Doe'
         24        DO_FCALL                                      0  $14     
         25        ASSIGN                                                   !3, $14
   23    26        INIT_METHOD_CALL                                         !2, 'appendChild'
         27        SEND_VAR_EX                                              !3
         28        DO_FCALL                                      0          
   24    29        INIT_METHOD_CALL                                         !0, 'appendChild'
         30        SEND_VAR_EX                                              !2
         31        DO_FCALL                                      0          
   27    32        INIT_METHOD_CALL                                         !0, 'save'
         33        SEND_VAL_EX                                              'output.xml'
         34        DO_FCALL                                      0          
   29    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.81 ms | 1395 KiB | 13 Q