3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA <?xml version="1.0" encoding="utf-8" standalone="yes"?> <Information> <Events> <Event> <Time>3141.29</Time> <PrimaryObject ID="487"> <Name>Player1</Name> <Country>us</Country> </PrimaryObject> <Action>Move</Action> <SecondaryObject ID="814"> <Name>Dog</Name> <Parent>487</Parent> </SecondaryObject> </Event> <Event> <Time>3141.29</Time> <PrimaryObject ID="488"> <Name>Player2</Name> <Country>us</Country> </PrimaryObject> <Action>Move</Action> <SecondaryObject ID="814"> <Name>Dog</Name> <Parent>488</Parent> </SecondaryObject> </Event> </Events> </Information> DATA; $xml=simplexml_load_string($data) or die("Error: Cannot create object"); foreach($xml->Events->Event as $events) { $id = $events->PrimaryObject->attributes(); $name = $events->PrimaryObject->Name; echo $id['ID'].' '. $name . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 25
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/1CSaM
function name:  (null)
number of ops:  27
compiled vars:  !0 = $data, !1 = $xml, !2 = $events, !3 = $id, !4 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22+standalone%3D%22yes%22%3F%3E%0A%3CInformation%3E%0A++++%3CEvents%3E%0A++++++++%3CEvent%3E%0A++++++++++++%3CTime%3E3141.29%3C%2FTime%3E%0A++++++++++++%3CPrimaryObject+ID%3D%22487%22%3E%0A++++++++++++++++%3CName%3EPlayer1%3C%2FName%3E%0A++++++++++++++++%3CCountry%3Eus%3C%2FCountry%3E%0A++++++++++++%3C%2FPrimaryObject%3E%0A++++++++++++%3CAction%3EMove%3C%2FAction%3E%0A++++++++++++%3CSecondaryObject+ID%3D%22814%22%3E%0A++++++++++++++++%3CName%3EDog%3C%2FName%3E%0A++++++++++++++++%3CParent%3E487%3C%2FParent%3E%0A++++++++++++%3C%2FSecondaryObject%3E%0A++++++++%3C%2FEvent%3E%0A++++++++%3CEvent%3E%0A++++++++++++%3CTime%3E3141.29%3C%2FTime%3E%0A++++++++++++%3CPrimaryObject+ID%3D%22488%22%3E%0A++++++++++++++++%3CName%3EPlayer2%3C%2FName%3E%0A++++++++++++++++%3CCountry%3Eus%3C%2FCountry%3E%0A++++++++++++%3C%2FPrimaryObject%3E%0A++++++++++++%3CAction%3EMove%3C%2FAction%3E%0A++++++++++++%3CSecondaryObject+ID%3D%22814%22%3E%0A++++++++++++++++%3CName%3EDog%3C%2FName%3E%0A++++++++++++++++%3CParent%3E488%3C%2FParent%3E%0A++++++++++++%3C%2FSecondaryObject%3E%0A++++++++%3C%2FEvent%3E%0A++++%3C%2FEvents%3E%0A%3C%2FInformation%3E'
   36     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                           ~7      !1, $6
          5      > JMPNZ_EX                                         ~7      ~7, ->8
          6    > > EXIT                                                     'Error%3A+Cannot+create+object'
          7*       BOOL                                             ~7      <true>
   38     8    >   FETCH_OBJ_R                                      ~8      !1, 'Events'
          9        FETCH_OBJ_R                                      ~9      ~8, 'Event'
         10      > FE_RESET_R                                       $10     ~9, ->25
         11    > > FE_FETCH_R                                               $10, !2, ->25
   39    12    >   FETCH_OBJ_R                                      ~11     !2, 'PrimaryObject'
         13        INIT_METHOD_CALL                                         ~11, 'attributes'
         14        DO_FCALL                                      0  $12     
         15        ASSIGN                                                   !3, $12
   40    16        FETCH_OBJ_R                                      ~14     !2, 'PrimaryObject'
         17        FETCH_OBJ_R                                      ~15     ~14, 'Name'
         18        ASSIGN                                                   !4, ~15
   41    19        FETCH_DIM_R                                      ~17     !3, 'ID'
         20        CONCAT                                           ~18     ~17, '+'
         21        CONCAT                                           ~19     ~18, !4
         22        CONCAT                                           ~20     ~19, '%0A'
         23        ECHO                                                     ~20
   38    24      > JMP                                                      ->11
         25    >   FE_FREE                                                  $10
   42    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.66 ms | 1450 KiB | 14 Q