3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "<?xml version='1.0' encoding='UTF-8'?> <note> <to>Tove</to> <from>Jani</from> <heading>123</heading> <body>Don't forget me this weekend!</body> </note> "; $sxe = new SimpleXMLElement($string); $sxe->addAttribute('test', '2312'); echo $sxe->test; print_r($sxe);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Yq37
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $sxe
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%271.0%27+encoding%3D%27UTF-8%27%3F%3E%0A%3Cnote%3E%0A%3Cto%3ETove%3C%2Fto%3E%0A%3Cfrom%3EJani%3C%2Ffrom%3E%0A%3Cheading%3E123%3C%2Fheading%3E%0A%3Cbody%3EDon%27t+forget+me+this+weekend%21%3C%2Fbody%3E%0A%3C%2Fnote%3E%0A'
   11     1        NEW                                              $3      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   12     5        INIT_METHOD_CALL                                         !1, 'addAttribute'
          6        SEND_VAL_EX                                              'test'
          7        SEND_VAL_EX                                              '2312'
          8        DO_FCALL                                      0          
   14     9        FETCH_OBJ_R                                      ~7      !1, 'test'
         10        ECHO                                                     ~7
   16    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.16 ms | 1394 KiB | 15 Q