3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = ' <users> <learner name="John"> <rater name="John" email="john@domain.com" group="Self"></rater> <rater name="Jane" email="jane@domain.com" group="Manager"></rater> <rater name="Nathan" email="nathan@domain.com" group="Peers"></rater> </learner> <learner name="Jane"> <rater name="Jane" email="jane@domain.com" group="Self"></rater> <rater name="John" email="john@domain.com" group="Peers"></rater> <rater name="Nathan" email="nathan@domain.com" group="Others"></rater> </learner> </users> '; $sxe = simplexml_load_string($xml); foreach($sxe as $learner){ $name = $learner->attributes()['name']; echo "Learner $name <br/>Rated by:-<br/>\n"; foreach($learner->rater as $rater){ foreach($rater->attributes() as $key => $value){ echo " - $key = $value <br/>\n"; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 34
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 34
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 32
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 32
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 30
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 30
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 32
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/iRflU
function name:  (null)
number of ops:  36
compiled vars:  !0 = $xml, !1 = $sxe, !2 = $learner, !3 = $name, !4 = $rater, !5 = $value, !6 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%0A%3Cusers%3E%0A++++%3Clearner+name%3D%22John%22%3E%0A++++++++%3Crater+name%3D%22John%22+email%3D%22john%40domain.com%22+group%3D%22Self%22%3E%3C%2Frater%3E%0A++++++++%3Crater+name%3D%22Jane%22+email%3D%22jane%40domain.com%22+group%3D%22Manager%22%3E%3C%2Frater%3E%0A++++++++%3Crater+name%3D%22Nathan%22+email%3D%22nathan%40domain.com%22+group%3D%22Peers%22%3E%3C%2Frater%3E%0A++++%3C%2Flearner%3E%0A++++%3Clearner+name%3D%22Jane%22%3E%0A++++++++%3Crater+name%3D%22Jane%22+email%3D%22jane%40domain.com%22+group%3D%22Self%22%3E%3C%2Frater%3E%0A++++++++%3Crater+name%3D%22John%22+email%3D%22john%40domain.com%22+group%3D%22Peers%22%3E%3C%2Frater%3E%0A++++++++%3Crater+name%3D%22Nathan%22+email%3D%22nathan%40domain.com%22+group%3D%22Others%22%3E%3C%2Frater%3E%0A++++%3C%2Flearner%3E%0A%3C%2Fusers%3E%0A'
   17     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $8      
          4        ASSIGN                                                   !1, $8
   19     5      > FE_RESET_R                                       $10     !1, ->34
          6    > > FE_FETCH_R                                               $10, !2, ->34
   20     7    >   INIT_METHOD_CALL                                         !2, 'attributes'
          8        DO_FCALL                                      0  $11     
          9        FETCH_DIM_R                                      ~12     $11, 'name'
         10        ASSIGN                                                   !3, ~12
   21    11        ROPE_INIT                                     3  ~15     'Learner+'
         12        ROPE_ADD                                      1  ~15     ~15, !3
         13        ROPE_END                                      2  ~14     ~15, '+%3Cbr%2F%3ERated+by%3A-%3Cbr%2F%3E%0A'
         14        ECHO                                                     ~14
   22    15        FETCH_OBJ_R                                      ~17     !2, 'rater'
         16      > FE_RESET_R                                       $18     ~17, ->32
         17    > > FE_FETCH_R                                               $18, !4, ->32
   23    18    >   INIT_METHOD_CALL                                         !4, 'attributes'
         19        DO_FCALL                                      0  $19     
         20      > FE_RESET_R                                       $20     $19, ->30
         21    > > FE_FETCH_R                                       ~21     $20, !5, ->30
         22    >   ASSIGN                                                   !6, ~21
   24    23        ROPE_INIT                                     5  ~24     '+-+'
         24        ROPE_ADD                                      1  ~24     ~24, !6
         25        ROPE_ADD                                      2  ~24     ~24, '+%3D+'
         26        ROPE_ADD                                      3  ~24     ~24, !5
         27        ROPE_END                                      4  ~23     ~24, '+%3Cbr%2F%3E%0A'
         28        ECHO                                                     ~23
   23    29      > JMP                                                      ->21
         30    >   FE_FREE                                                  $20
   22    31      > JMP                                                      ->17
         32    >   FE_FREE                                                  $18
   19    33      > JMP                                                      ->6
         34    >   FE_FREE                                                  $10
   27    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.51 ms | 1400 KiB | 15 Q