3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sxe = new SimpleXMLElement('<foo></foo>'); $sxe->addChild('bar'); $arrResults['empty node'] = $sxe->asXML(); $sxe = new SimpleXMLElement('<foo></foo>'); $sxe->addChild('bar', ''); $arrResults['empty string'] = $sxe->asXML(); $sxe = new SimpleXMLElement('<foo></foo>'); $sxe->addChild('bar'); $sxe->bar = ''; $arrResults['overwritten empty string'] = $sxe->asXML(); foreach($arrResults as $key => $strResult){ echo $key . ': ' . $strResult; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 43
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 43
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/mQaLd
function name:  (null)
number of ops:  45
compiled vars:  !0 = $sxe, !1 = $arrResults, !2 = $strResult, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'SimpleXMLElement'
          1        SEND_VAL_EX                                              '%3Cfoo%3E%3C%2Ffoo%3E'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    4     4        INIT_METHOD_CALL                                         !0, 'addChild'
          5        SEND_VAL_EX                                              'bar'
          6        DO_FCALL                                      0          
    5     7        INIT_METHOD_CALL                                         !0, 'asXML'
          8        DO_FCALL                                      0  $9      
          9        ASSIGN_DIM                                               !1, 'empty+node'
         10        OP_DATA                                                  $9
    7    11        NEW                                              $10     'SimpleXMLElement'
         12        SEND_VAL_EX                                              '%3Cfoo%3E%3C%2Ffoo%3E'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !0, $10
    8    15        INIT_METHOD_CALL                                         !0, 'addChild'
         16        SEND_VAL_EX                                              'bar'
         17        SEND_VAL_EX                                              ''
         18        DO_FCALL                                      0          
    9    19        INIT_METHOD_CALL                                         !0, 'asXML'
         20        DO_FCALL                                      0  $15     
         21        ASSIGN_DIM                                               !1, 'empty+string'
         22        OP_DATA                                                  $15
   11    23        NEW                                              $16     'SimpleXMLElement'
         24        SEND_VAL_EX                                              '%3Cfoo%3E%3C%2Ffoo%3E'
         25        DO_FCALL                                      0          
         26        ASSIGN                                                   !0, $16
   12    27        INIT_METHOD_CALL                                         !0, 'addChild'
         28        SEND_VAL_EX                                              'bar'
         29        DO_FCALL                                      0          
   13    30        ASSIGN_OBJ                                               !0, 'bar'
         31        OP_DATA                                                  ''
   14    32        INIT_METHOD_CALL                                         !0, 'asXML'
         33        DO_FCALL                                      0  $22     
         34        ASSIGN_DIM                                               !1, 'overwritten+empty+string'
         35        OP_DATA                                                  $22
   16    36      > FE_RESET_R                                       $23     !1, ->43
         37    > > FE_FETCH_R                                       ~24     $23, !2, ->43
         38    >   ASSIGN                                                   !3, ~24
   17    39        CONCAT                                           ~26     !3, '%3A+'
         40        CONCAT                                           ~27     ~26, !2
         41        ECHO                                                     ~27
   16    42      > JMP                                                      ->37
         43    >   FE_FREE                                                  $23
   18    44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.6 ms | 1399 KiB | 13 Q