3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<XML <a> <foo name="one" game="lonely">1</foo> <foo name="two" game"wow">2</foo> </a> XML; $xml = simplexml_load_string($string); foreach($xml->foo[0]->attributes() as $a => $b) { echo $a,'="',$b,"\"\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/jU7Ag
function name:  (null)
number of ops:  19
compiled vars:  !0 = $string, !1 = $xml, !2 = $b, !3 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Ca%3E%0A+%3Cfoo+name%3D%22one%22+game%3D%22lonely%22%3E1%3C%2Ffoo%3E%0A+%3Cfoo+name%3D%22two%22+game%22wow%22%3E2%3C%2Ffoo%3E%0A%3C%2Fa%3E'
    9     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   10     5        FETCH_OBJ_R                                      ~7      !1, 'foo'
          6        FETCH_DIM_R                                      ~8      ~7, 0
          7        INIT_METHOD_CALL                                         ~8, 'attributes'
          8        DO_FCALL                                      0  $9      
          9      > FE_RESET_R                                       $10     $9, ->17
         10    > > FE_FETCH_R                                       ~11     $10, !2, ->17
         11    >   ASSIGN                                                   !3, ~11
   11    12        ECHO                                                     !3
         13        ECHO                                                     '%3D%22'
         14        ECHO                                                     !2
         15        ECHO                                                     '%22%0A'
   10    16      > JMP                                                      ->10
         17    >   FE_FREE                                                  $10
   13    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.04 ms | 1395 KiB | 15 Q