3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = <<<XML <items> <hats> <a id="Chicago BULLS" img="bulls.jpeg" cost="$25.00" /> <b id="Toronto RAPTORS" img="raptors.jpeg" cost="$25.00" /> <c id="Orlando MAGIC" img="magic.jpeg" cost="$25.00" /> </hats> <clothes> <a id="Chicago BULLS 23" img="bullstee.jpeg" cost="$30.00" /> <b id="Toronto RAPTORS 23" img="torontotee.jpeg" cost="$30.00" /> <c id="Orlando MAGIC 23" img="magictee.jpeg" cost="$30.00" /> </clothes> </items> XML; $xml = simplexml_load_string($x); foreach ($xml->children() as $name => $value) { echo "$name: <br />"; foreach ($name->children() as $item) { echo "$item[id], $item[img], $item[cost]<br />"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 30
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 30
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 28
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 28
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 28
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/kKYOX
function name:  (null)
number of ops:  32
compiled vars:  !0 = $x, !1 = $xml, !2 = $value, !3 = $name, !4 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Citems%3E%0A%3Chats%3E%0A++++%3Ca+id%3D%22Chicago+BULLS%22+img%3D%22bulls.jpeg%22+cost%3D%22%2425.00%22+%2F%3E%0A++++%3Cb+id%3D%22Toronto+RAPTORS%22+img%3D%22raptors.jpeg%22+cost%3D%22%2425.00%22+%2F%3E%0A++++%3Cc+id%3D%22Orlando+MAGIC%22+img%3D%22magic.jpeg%22+cost%3D%22%2425.00%22+%2F%3E%0A%3C%2Fhats%3E%0A%3Cclothes%3E%0A++++%3Ca+id%3D%22Chicago+BULLS+23%22+img%3D%22bullstee.jpeg%22+cost%3D%22%2430.00%22+%2F%3E%0A++++%3Cb+id%3D%22Toronto+RAPTORS+23%22+img%3D%22torontotee.jpeg%22+cost%3D%22%2430.00%22+%2F%3E%0A++++%3Cc+id%3D%22Orlando+MAGIC+23%22+img%3D%22magictee.jpeg%22+cost%3D%22%2430.00%22+%2F%3E%0A%3C%2Fclothes%3E%0A%3C%2Fitems%3E'
   17     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
   19     5        INIT_METHOD_CALL                                         !1, 'children'
          6        DO_FCALL                                      0  $8      
          7      > FE_RESET_R                                       $9      $8, ->30
          8    > > FE_FETCH_R                                       ~10     $9, !2, ->30
          9    >   ASSIGN                                                   !3, ~10
   20    10        NOP                                                      
         11        FAST_CONCAT                                      ~12     !3, '%3A+%3Cbr+%2F%3E'
         12        ECHO                                                     ~12
   21    13        INIT_METHOD_CALL                                         !3, 'children'
         14        DO_FCALL                                      0  $13     
         15      > FE_RESET_R                                       $14     $13, ->28
         16    > > FE_FETCH_R                                               $14, !4, ->28
   22    17    >   FETCH_DIM_R                                      ~15     !4, 'id'
         18        ROPE_INIT                                     6  ~19     ~15
         19        ROPE_ADD                                      1  ~19     ~19, '%2C+'
         20        FETCH_DIM_R                                      ~16     !4, 'img'
         21        ROPE_ADD                                      2  ~19     ~19, ~16
         22        ROPE_ADD                                      3  ~19     ~19, '%2C+'
         23        FETCH_DIM_R                                      ~17     !4, 'cost'
         24        ROPE_ADD                                      4  ~19     ~19, ~17
         25        ROPE_END                                      5  ~18     ~19, '%3Cbr+%2F%3E'
         26        ECHO                                                     ~18
   21    27      > JMP                                                      ->16
         28    >   FE_FREE                                                  $14
   19    29      > JMP                                                      ->8
         30    >   FE_FREE                                                  $9
   24    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.32 ms | 1400 KiB | 15 Q