3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '<?xml version="1.0" encoding="utf-8" ?> <note> <to> <form>D</form> <heading>E</heading> <body>F</body> </to> <to> <form>A</form> <heading>B</heading> <body>C</body> </to> </note>'; $xml = simplexml_load_string($data); foreach ($xml->to as $to) { if ($to->form == 'A') { // našel jsem <to>, ve kterém je <form>A</form> // a tady s ním můžu pracovat echo "heading: ".$to->heading."\nbody: ".$to->body; } }
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 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/6YiTS
function name:  (null)
number of ops:  20
compiled vars:  !0 = $data, !1 = $xml, !2 = $to
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+%3F%3E%0A%3Cnote%3E%0A++++++%3Cto%3E%0A+++++++%3Cform%3ED%3C%2Fform%3E%0A+++++++%3Cheading%3EE%3C%2Fheading%3E%0A+++++++%3Cbody%3EF%3C%2Fbody%3E%0A++++%3C%2Fto%3E%0A++++%3Cto%3E%0A++++++++%3Cform%3EA%3C%2Fform%3E%0A++++++++%3Cheading%3EB%3C%2Fheading%3E%0A++++++++%3Cbody%3EC%3C%2Fbody%3E%0A++++%3C%2Fto%3E%0A%3C%2Fnote%3E'
   17     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   19     5        FETCH_OBJ_R                                      ~6      !1, 'to'
          6      > FE_RESET_R                                       $7      ~6, ->18
          7    > > FE_FETCH_R                                               $7, !2, ->18
   20     8    >   FETCH_OBJ_R                                      ~8      !2, 'form'
          9        IS_EQUAL                                                 ~8, 'A'
         10      > JMPZ                                                     ~9, ->17
   22    11    >   FETCH_OBJ_R                                      ~10     !2, 'heading'
         12        CONCAT                                           ~11     'heading%3A+', ~10
         13        CONCAT                                           ~12     ~11, '%0Abody%3A+'
         14        FETCH_OBJ_R                                      ~13     !2, 'body'
         15        CONCAT                                           ~14     ~12, ~13
         16        ECHO                                                     ~14
   19    17    > > JMP                                                      ->7
         18    >   FE_FREE                                                  $7
   24    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.18 ms | 1395 KiB | 15 Q