3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = simplexml_load_string("<?xml version='1.0' ?> <ImageSets> <ImageSet Category='primary'> <SwatchImage> <URL>www.url.jpg</URL> </SwatchImage> </ImageSet> </ImageSets> "); $primary_url = ''; foreach ($xml->ImageSet as $set) { if ($set->attributes()->Category == 'primary') { $primary_url = $set->SwatchImage->URL; break; } } echo $primary_url;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 18
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 18
Branch analysis from position: 18
filename:       /in/BOXUh
function name:  (null)
number of ops:  21
compiled vars:  !0 = $xml, !1 = $primary_url, !2 = $set
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'simplexml_load_string'
          1        SEND_VAL                                                 '%3C%3Fxml+version%3D%271.0%27+%3F%3E%0A++++%3CImageSets%3E%0A++++++++%3CImageSet+Category%3D%27primary%27%3E%0A++++++++++++%3CSwatchImage%3E%0A++++++++++++++++%3CURL%3Ewww.url.jpg%3C%2FURL%3E%0A++++++++++++%3C%2FSwatchImage%3E%0A++++++++%3C%2FImageSet%3E%0A++++%3C%2FImageSets%3E%0A++++'
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
   12     4        ASSIGN                                                   !1, ''
   13     5        FETCH_OBJ_R                                      ~6      !0, 'ImageSet'
          6      > FE_RESET_R                                       $7      ~6, ->18
          7    > > FE_FETCH_R                                               $7, !2, ->18
   14     8    >   INIT_METHOD_CALL                                         !2, 'attributes'
          9        DO_FCALL                                      0  $8      
         10        FETCH_OBJ_R                                      ~9      $8, 'Category'
         11        IS_EQUAL                                                 ~9, 'primary'
         12      > JMPZ                                                     ~10, ->17
   15    13    >   FETCH_OBJ_R                                      ~11     !2, 'SwatchImage'
         14        FETCH_OBJ_R                                      ~12     ~11, 'URL'
         15        ASSIGN                                                   !1, ~12
   16    16      > JMP                                                      ->18
   13    17    > > JMP                                                      ->7
         18    >   FE_FREE                                                  $7
   19    19        ECHO                                                     !1
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.49 ms | 1395 KiB | 15 Q