3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new XMLWriter(); $xml->openMemory(); $xml->startElement('parent'); $xml->writeElement('child'); $xml->writeAttribute('parentAttribute', 'a value'); $xml->endElement(); echo $xml->outputMemory(); $xml2 = new XMLWriter(); $xml2->openMemory(); $xml2->startElement('parent'); $xml2->writeAttribute('parentAttribute', 'a value'); $xml2->writeElement('child'); $xml2->endElement(); echo $xml2->outputMemory();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CLBht
function name:  (null)
number of ops:  41
compiled vars:  !0 = $xml, !1 = $xml2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'XMLWriter'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    4     3        INIT_METHOD_CALL                                         !0, 'openMemory'
          4        DO_FCALL                                      0          
    6     5        INIT_METHOD_CALL                                         !0, 'startElement'
          6        SEND_VAL_EX                                              'parent'
          7        DO_FCALL                                      0          
    7     8        INIT_METHOD_CALL                                         !0, 'writeElement'
          9        SEND_VAL_EX                                              'child'
         10        DO_FCALL                                      0          
    8    11        INIT_METHOD_CALL                                         !0, 'writeAttribute'
         12        SEND_VAL_EX                                              'parentAttribute'
         13        SEND_VAL_EX                                              'a+value'
         14        DO_FCALL                                      0          
    9    15        INIT_METHOD_CALL                                         !0, 'endElement'
         16        DO_FCALL                                      0          
   11    17        INIT_METHOD_CALL                                         !0, 'outputMemory'
         18        DO_FCALL                                      0  $10     
         19        ECHO                                                     $10
   13    20        NEW                                              $11     'XMLWriter'
         21        DO_FCALL                                      0          
         22        ASSIGN                                                   !1, $11
   14    23        INIT_METHOD_CALL                                         !1, 'openMemory'
         24        DO_FCALL                                      0          
   16    25        INIT_METHOD_CALL                                         !1, 'startElement'
         26        SEND_VAL_EX                                              'parent'
         27        DO_FCALL                                      0          
   17    28        INIT_METHOD_CALL                                         !1, 'writeAttribute'
         29        SEND_VAL_EX                                              'parentAttribute'
         30        SEND_VAL_EX                                              'a+value'
         31        DO_FCALL                                      0          
   18    32        INIT_METHOD_CALL                                         !1, 'writeElement'
         33        SEND_VAL_EX                                              'child'
         34        DO_FCALL                                      0          
   19    35        INIT_METHOD_CALL                                         !1, 'endElement'
         36        DO_FCALL                                      0          
   21    37        INIT_METHOD_CALL                                         !1, 'outputMemory'
         38        DO_FCALL                                      0  $19     
         39        ECHO                                                     $19
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.29 ms | 1395 KiB | 13 Q