3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!class_exists("SimpleXMLElement")) { return; } $xml = new SimpleXMLElement(<<<XML <?xml version="1.0" encoding="UTF-8"?> <aa> <bs> <b>b</b> </bs> <cs><c>b</c></cs> <ds><d id="d"></d></ds> <es> <e id="e"></e> </es> <fs><f id="f"></f><f id="f"></f></fs> </aa> XML ); print_r($xml->ds); print_r($xml->es); echo "d@id = {$xml->ds->d['id']}\n"; echo "e@id = {$xml->es->e['id']}\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rabcu
function name:  (null)
number of ops:  33
compiled vars:  !0 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'class_exists'
          1        SEND_VAL                                                 'SimpleXMLElement'
          2        DO_ICALL                                         $1      
          3        BOOL_NOT                                         ~2      $1
          4      > JMPZ                                                     ~2, ->6
    4     5    > > RETURN                                                   null
    7     6    >   NEW                                              $3      'SimpleXMLElement'
    8     7        SEND_VAL_EX                                              '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Caa%3E%0A++++++++%3Cbs%3E%0A++++++++++++++++%3Cb%3Eb%3C%2Fb%3E%0A++++++++%3C%2Fbs%3E%0A++++++++%3Ccs%3E%3Cc%3Eb%3C%2Fc%3E%3C%2Fcs%3E%0A++++++++%3Cds%3E%3Cd+id%3D%22d%22%3E%3C%2Fd%3E%3C%2Fds%3E%0A++++++++%3Ces%3E%0A++++++++++++++++%3Ce+id%3D%22e%22%3E%3C%2Fe%3E%0A++++++++%3C%2Fes%3E%0A++++++++%3Cfs%3E%3Cf+id%3D%22f%22%3E%3C%2Ff%3E%3Cf+id%3D%22f%22%3E%3C%2Ff%3E%3C%2Ffs%3E%0A%3C%2Faa%3E'
          8        DO_FCALL                                      0          
    7     9        ASSIGN                                                   !0, $3
   23    10        INIT_FCALL                                               'print_r'
         11        FETCH_OBJ_R                                      ~6      !0, 'ds'
         12        SEND_VAL                                                 ~6
         13        DO_ICALL                                                 
   24    14        INIT_FCALL                                               'print_r'
         15        FETCH_OBJ_R                                      ~8      !0, 'es'
         16        SEND_VAL                                                 ~8
         17        DO_ICALL                                                 
   26    18        ROPE_INIT                                     3  ~14     'd%40id+%3D+'
         19        FETCH_OBJ_R                                      ~10     !0, 'ds'
         20        FETCH_OBJ_R                                      ~11     ~10, 'd'
         21        FETCH_DIM_R                                      ~12     ~11, 'id'
         22        ROPE_ADD                                      1  ~14     ~14, ~12
         23        ROPE_END                                      2  ~13     ~14, '%0A'
         24        ECHO                                                     ~13
   27    25        ROPE_INIT                                     3  ~20     'e%40id+%3D+'
         26        FETCH_OBJ_R                                      ~16     !0, 'es'
         27        FETCH_OBJ_R                                      ~17     ~16, 'e'
         28        FETCH_DIM_R                                      ~18     ~17, 'id'
         29        ROPE_ADD                                      1  ~20     ~20, ~18
         30        ROPE_END                                      2  ~19     ~20, '%0A'
         31        ECHO                                                     ~19
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.64 ms | 1396 KiB | 17 Q