3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <html> <head><title></title></head> <body> <content type="text">the content</content> </body> </html> XML; $xe = new SimpleXMLElement($xml); $ne = new SimpleXMLElement("<div></div>"); $xe->body->content = $ne; echo $xe->asXML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4n1pi
function name:  (null)
number of ops:  16
compiled vars:  !0 = $xml, !1 = $xe, !2 = $ne
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%0A%3Chead%3E%3Ctitle%3E%3C%2Ftitle%3E%3C%2Fhead%3E%0A%3Cbody%3E%0A%3Ccontent+type%3D%22text%22%3Ethe+content%3C%2Fcontent%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   10     1        NEW                                              $4      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   11     5        NEW                                              $7      'SimpleXMLElement'
          6        SEND_VAL_EX                                              '%3Cdiv%3E%3C%2Fdiv%3E'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $7
   12     9        FETCH_OBJ_W                                      $10     !1, 'body'
         10        ASSIGN_OBJ                                               $10, 'content'
         11        OP_DATA                                                  !2
   13    12        INIT_METHOD_CALL                                         !1, 'asXML'
         13        DO_FCALL                                      0  $12     
         14        ECHO                                                     $12
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.78 ms | 1393 KiB | 13 Q