3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<XML <a> <foo name="one" game="lonely">1</foo> </a> XML; $xml = simplexml_load_string($string); if(!empty($xml->foo[0]->attributes())){ foreach($xml->foo[0]->attributes() as $a => $b) { echo $a,'="',$b,"\"\n"; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 24
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
Branch analysis from position: 25
filename:       /in/R32Bv
function name:  (null)
number of ops:  26
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%3C%2Fa%3E'
    8     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    9     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        BOOL_NOT                                         ~10     $9
         10        BOOL_NOT                                         ~11     ~10
         11      > JMPZ                                                     ~11, ->25
   10    12    >   FETCH_OBJ_R                                      ~12     !1, 'foo'
         13        FETCH_DIM_R                                      ~13     ~12, 0
         14        INIT_METHOD_CALL                                         ~13, 'attributes'
         15        DO_FCALL                                      0  $14     
         16      > FE_RESET_R                                       $15     $14, ->24
         17    > > FE_FETCH_R                                       ~16     $15, !2, ->24
         18    >   ASSIGN                                                   !3, ~16
   11    19        ECHO                                                     !3
         20        ECHO                                                     '%3D%22'
         21        ECHO                                                     !2
         22        ECHO                                                     '%22%0A'
   10    23      > JMP                                                      ->17
         24    >   FE_FREE                                                  $15
   14    25    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.91 ms | 1438 KiB | 14 Q