3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '<?xml version="1.0"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don\'t forget me this weekend!</body> <recursive> <val>2</val> <val>4</val> </recursive> </note>'; $xml1 = new SimpleXmlIterator($str, 0, false); $xml = (array) $xml1; echo $xml['note']['to']; echo $xml['note']['recursive']['val'][0];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cnQ8D
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str, !1 = $xml1, !2 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Cnote%3E%0A++++%3Cto%3ETove%3C%2Fto%3E%0A++++%3Cfrom%3EJani%3C%2Ffrom%3E%0A++++%3Cheading%3EReminder%3C%2Fheading%3E%0A++++%3Cbody%3EDon%27t+forget+me+this+weekend%21%3C%2Fbody%3E%0A%09%3Crecursive%3E%0A%09%09%3Cval%3E2%3C%2Fval%3E%0A%09%09%3Cval%3E4%3C%2Fval%3E%0A%09%3C%2Frecursive%3E%0A%3C%2Fnote%3E'
   16     1        NEW                                              $4      'SimpleXmlIterator'
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              0
          4        SEND_VAL_EX                                              <false>
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $4
   17     7        CAST                                          7  ~7      !1
          8        ASSIGN                                                   !2, ~7
   19     9        FETCH_DIM_R                                      ~9      !2, 'note'
         10        FETCH_DIM_R                                      ~10     ~9, 'to'
         11        ECHO                                                     ~10
   20    12        FETCH_DIM_R                                      ~11     !2, 'note'
         13        FETCH_DIM_R                                      ~12     ~11, 'recursive'
         14        FETCH_DIM_R                                      ~13     ~12, 'val'
         15        FETCH_DIM_R                                      ~14     ~13, 0
         16        ECHO                                                     ~14
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.78 ms | 1385 KiB | 13 Q