3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<< EOT <?xml version='1.0' encoding='UTF-8'?> <eveapi version="2"> <currentTime>2013-10-01 18:00:01</currentTime> <result> <rowset name="members" key="characterID" columns="characterID, name"> <row characterID="2234" name="Bob"> <format type="test">Bob format</format> </row> <row characterID="555" name="John">test1 <format type="test">John format</format> </row> </rowset> </result> <cachedUntil>2013-10-01 18:57:01</cachedUntil> </eveapi> EOT; $simpleXML = simplexml_load_string($xml); // Load XML string data into the simplexml object parser foreach ($simpleXML->result->rowset as $rowset) { foreach ($rowset->row as $row) { $titles = []; echo "cp "; print_r($row); echo " cp "; $name = $row['name']->__toString(); foreach($row as $attrib){ if($attrib['name']->__toString() === 'titles'){ foreach($attrib as $title){ $titles[] = $title['titleName']->__toString(); } } } echo $name . ' : ' . implode(' - ', $titles) . "<br/>\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 51
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 51
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 49
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 49
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 39
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 39
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 38
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 37
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 37
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 37
Branch analysis from position: 38
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 39
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 49
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
filename:       /in/JKrKh
function name:  (null)
number of ops:  53
compiled vars:  !0 = $xml, !1 = $simpleXML, !2 = $rowset, !3 = $row, !4 = $titles, !5 = $name, !6 = $attrib, !7 = $title
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%271.0%27+encoding%3D%27UTF-8%27%3F%3E%0A%3Ceveapi+version%3D%222%22%3E%0A++%3CcurrentTime%3E2013-10-01+18%3A00%3A01%3C%2FcurrentTime%3E%0A++%3Cresult%3E%0A++++%3Crowset+name%3D%22members%22+key%3D%22characterID%22+columns%3D%22characterID%2C+name%22%3E%0A++++++%3Crow+characterID%3D%222234%22+name%3D%22Bob%22%3E%0A++++++++%3Cformat+type%3D%22test%22%3EBob+format%3C%2Fformat%3E%0A++++++%3C%2Frow%3E%0A++++++%3Crow+characterID%3D%22555%22+name%3D%22John%22%3Etest1%0A++++++++%3Cformat+type%3D%22test%22%3EJohn+format%3C%2Fformat%3E%0A++++++%3C%2Frow%3E%0A++++%3C%2Frowset%3E%0A++%3C%2Fresult%3E%0A++%3CcachedUntil%3E2013-10-01+18%3A57%3A01%3C%2FcachedUntil%3E%0A%3C%2Feveapi%3E'
   20     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $9      
          4        ASSIGN                                                   !1, $9
   22     5        FETCH_OBJ_R                                      ~11     !1, 'result'
          6        FETCH_OBJ_R                                      ~12     ~11, 'rowset'
          7      > FE_RESET_R                                       $13     ~12, ->51
          8    > > FE_FETCH_R                                               $13, !2, ->51
   23     9    >   FETCH_OBJ_R                                      ~14     !2, 'row'
         10      > FE_RESET_R                                       $15     ~14, ->49
         11    > > FE_FETCH_R                                               $15, !3, ->49
   24    12    >   ASSIGN                                                   !4, <array>
   25    13        ECHO                                                     'cp+'
   26    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
   27    17        ECHO                                                     '+cp+'
   28    18        FETCH_DIM_R                                      ~18     !3, 'name'
         19        INIT_METHOD_CALL                                         ~18, '__toString'
         20        DO_FCALL                                      0  $19     
         21        ASSIGN                                                   !5, $19
   29    22      > FE_RESET_R                                       $21     !3, ->39
         23    > > FE_FETCH_R                                               $21, !6, ->39
   30    24    >   FETCH_DIM_R                                      ~22     !6, 'name'
         25        INIT_METHOD_CALL                                         ~22, '__toString'
         26        DO_FCALL                                      0  $23     
         27        IS_IDENTICAL                                             $23, 'titles'
         28      > JMPZ                                                     ~24, ->38
   31    29    > > FE_RESET_R                                       $25     !6, ->37
         30    > > FE_FETCH_R                                               $25, !7, ->37
   32    31    >   FETCH_DIM_R                                      ~27     !7, 'titleName'
         32        INIT_METHOD_CALL                                         ~27, '__toString'
         33        DO_FCALL                                      0  $28     
         34        ASSIGN_DIM                                               !4
         35        OP_DATA                                                  $28
   31    36      > JMP                                                      ->30
         37    >   FE_FREE                                                  $25
   29    38    > > JMP                                                      ->23
         39    >   FE_FREE                                                  $21
   36    40        CONCAT                                           ~29     !5, '+%3A+'
         41        INIT_FCALL                                               'implode'
         42        SEND_VAL                                                 '+-+'
         43        SEND_VAR                                                 !4
         44        DO_ICALL                                         $30     
         45        CONCAT                                           ~31     ~29, $30
         46        CONCAT                                           ~32     ~31, '%3Cbr%2F%3E%0A'
         47        ECHO                                                     ~32
   23    48      > JMP                                                      ->11
         49    >   FE_FREE                                                  $15
   22    50      > JMP                                                      ->8
         51    >   FE_FREE                                                  $13
   38    52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.22 ms | 1400 KiB | 19 Q