3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument('1.0'); $doc->preserveWhiteSpace = false; $doc->load('./test.xml'); $doc->formatOutput = true; $root = $doc->documentElement; $news = $root->appendChild(new domElement("news")); $parentnews = $news->appendChild(new domElement("parentnews")); $parentnews->appendChild(new domElement("number", "2")); $parentnews->appendChild(new domElement("name", "次郎")); echo $doc->saveXML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HPTaK
function name:  (null)
number of ops:  45
compiled vars:  !0 = $doc, !1 = $root, !2 = $news, !3 = $parentnews
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'DOMDocument'
          1        SEND_VAL_EX                                              '1.0'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    5     4        ASSIGN_OBJ                                               !0, 'preserveWhiteSpace'
          5        OP_DATA                                                  <false>
    6     6        INIT_METHOD_CALL                                         !0, 'load'
          7        SEND_VAL_EX                                              '.%2Ftest.xml'
          8        DO_FCALL                                      0          
    7     9        ASSIGN_OBJ                                               !0, 'formatOutput'
         10        OP_DATA                                                  <true>
    9    11        FETCH_OBJ_R                                      ~10     !0, 'documentElement'
         12        ASSIGN                                                   !1, ~10
   10    13        INIT_METHOD_CALL                                         !1, 'appendChild'
         14        NEW                                              $12     'domElement'
         15        SEND_VAL_EX                                              'news'
         16        DO_FCALL                                      0          
         17        SEND_VAR_NO_REF_EX                                       $12
         18        DO_FCALL                                      0  $14     
         19        ASSIGN                                                   !2, $14
   11    20        INIT_METHOD_CALL                                         !2, 'appendChild'
         21        NEW                                              $16     'domElement'
         22        SEND_VAL_EX                                              'parentnews'
         23        DO_FCALL                                      0          
         24        SEND_VAR_NO_REF_EX                                       $16
         25        DO_FCALL                                      0  $18     
         26        ASSIGN                                                   !3, $18
   12    27        INIT_METHOD_CALL                                         !3, 'appendChild'
         28        NEW                                              $20     'domElement'
         29        SEND_VAL_EX                                              'number'
         30        SEND_VAL_EX                                              '2'
         31        DO_FCALL                                      0          
         32        SEND_VAR_NO_REF_EX                                       $20
         33        DO_FCALL                                      0          
   13    34        INIT_METHOD_CALL                                         !3, 'appendChild'
         35        NEW                                              $23     'domElement'
         36        SEND_VAL_EX                                              'name'
         37        SEND_VAL_EX                                              '%E6%AC%A1%E9%83%8E'
         38        DO_FCALL                                      0          
         39        SEND_VAR_NO_REF_EX                                       $23
         40        DO_FCALL                                      0          
   15    41        INIT_METHOD_CALL                                         !0, 'saveXML'
         42        DO_FCALL                                      0  $26     
         43        ECHO                                                     $26
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.92 ms | 1399 KiB | 13 Q