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->format); 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 = 52
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 52
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 50
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 50
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 40
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 40
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 39
Branch analysis from position: 30
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 38
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 38
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 38
Branch analysis from position: 39
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 40
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 50
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
filename:       /in/kVBMq
function name:  (null)
number of ops:  54
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, ->52
          8    > > FE_FETCH_R                                               $13, !2, ->52
   23     9    >   FETCH_OBJ_R                                      ~14     !2, 'row'
         10      > FE_RESET_R                                       $15     ~14, ->50
         11    > > FE_FETCH_R                                               $15, !3, ->50
   24    12    >   ASSIGN                                                   !4, <array>
   25    13        ECHO                                                     'cp+'
   26    14        INIT_FCALL                                               'print_r'
         15        FETCH_OBJ_R                                      ~17     !3, 'format'
         16        SEND_VAL                                                 ~17
         17        DO_ICALL                                                 
   27    18        ECHO                                                     '+cp+'
   28    19        FETCH_DIM_R                                      ~19     !3, 'name'
         20        INIT_METHOD_CALL                                         ~19, '__toString'
         21        DO_FCALL                                      0  $20     
         22        ASSIGN                                                   !5, $20
   29    23      > FE_RESET_R                                       $22     !3, ->40
         24    > > FE_FETCH_R                                               $22, !6, ->40
   30    25    >   FETCH_DIM_R                                      ~23     !6, 'name'
         26        INIT_METHOD_CALL                                         ~23, '__toString'
         27        DO_FCALL                                      0  $24     
         28        IS_IDENTICAL                                             $24, 'titles'
         29      > JMPZ                                                     ~25, ->39
   31    30    > > FE_RESET_R                                       $26     !6, ->38
         31    > > FE_FETCH_R                                               $26, !7, ->38
   32    32    >   FETCH_DIM_R                                      ~28     !7, 'titleName'
         33        INIT_METHOD_CALL                                         ~28, '__toString'
         34        DO_FCALL                                      0  $29     
         35        ASSIGN_DIM                                               !4
         36        OP_DATA                                                  $29
   31    37      > JMP                                                      ->31
         38    >   FE_FREE                                                  $26
   29    39    > > JMP                                                      ->24
         40    >   FE_FREE                                                  $22
   36    41        CONCAT                                           ~30     !5, '+%3A+'
         42        INIT_FCALL                                               'implode'
         43        SEND_VAL                                                 '+-+'
         44        SEND_VAR                                                 !4
         45        DO_ICALL                                         $31     
         46        CONCAT                                           ~32     ~30, $31
         47        CONCAT                                           ~33     ~32, '%3Cbr%2F%3E%0A'
         48        ECHO                                                     ~33
   23    49      > JMP                                                      ->11
         50    >   FE_FREE                                                  $15
   22    51      > JMP                                                      ->8
         52    >   FE_FREE                                                  $13
   38    53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.16 ms | 1400 KiB | 19 Q