3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<voorbeeld xmlns:kennis="link" xmlns:tagg="verbinding" xmlns:aanhef="doorgang" xmlns:voornaam="verwijzing" xmlns:achternaam="brug" xmlns:hobby="my.foo.urn"> <kennis> <tagg:a> <aanhef:a>Mevr </aanhef:a> <persoon> <voornaam:a>Caro</voornaam:a> <achternaam:a>Emerald gaat</achternaam:a> <hobby:a> graag zingen </hobby:a> </persoon> </tagg:a> </kennis> <kennis> <tagg:b> <aanhef:b>Dhr </aanhef:b> <persoon> <voornaam:b>Bas</voornaam:b> <achternaam:b>van de Ven</achternaam:b> <hobby:b> drummen </hobby:b> </persoon> </tagg:b> </kennis> <kennis> <tagg:c> <aanhef:c>Jongeman </aanhef:c> <persoon> <voornaam:c>Ruben</voornaam:c> <achternaam:c>Verhoeven</achternaam:c> <hobby:c> voetballen </hobby:c> </persoon> </tagg:c> </kennis> </voorbeeld>' ; $sxe = new SimplexmlElement($xml) ; foreach($sxe->kennis as $kennis) { $tagdata = $kennis->children('verbinding'); // EXTRA TAG $aanhefdata = $tagdata->children('doorgang');//AANHEF echo "De aanhef is : ".$tagdata->a.$aanhefdata->a; echo $tagdata->b.$aanhefdata->b; echo $tagdata->c.$aanhefdata->c; foreach($tagdata->persoon as $persoon) { $Vnaamdata = $persoon->children('verwijzing'); //VOORNAAM $Anaamdata = $persoon->children('brug');// ACHTERNAAM $hobbydata = $persoon->children('my.foo.urn');//HOBBY echo $tagdata->a.$aanhefdata->a.$Vnaamdata->a.$Anaamdata->a.$hobbydata->a; echo $tagdata->b.$aanhefdata->b.$Vnaamdata->b.$Anaamdata->b.$hobbydata->b; } /*echo $tagdata->b.$aanhefdata->b.$Anaamdata->b.$hobbydata->b; echo $tagdata->c.$aanhefdata->c.$Anaamdata->c.$hobbydata->c;*/ echo '<br/>'; } echo "<br>";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 68
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 68
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 65
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 65
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 65
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 68
filename:       /in/5iA9H
function name:  (null)
number of ops:  71
compiled vars:  !0 = $xml, !1 = $sxe, !2 = $kennis, !3 = $tagdata, !4 = $aanhefdata, !5 = $persoon, !6 = $Vnaamdata, !7 = $Anaamdata, !8 = $hobbydata
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cvoorbeeld+xmlns%3Akennis%3D%22link%22%0A++++++++++++++++++++xmlns%3Atagg%3D%22verbinding%22%0A++++++++++++++++++++xmlns%3Aaanhef%3D%22doorgang%22%0A++++++++++++++++++++xmlns%3Avoornaam%3D%22verwijzing%22%0A++++++++++++++++++++xmlns%3Aachternaam%3D%22brug%22%0A++++++++++++++++++++xmlns%3Ahobby%3D%22my.foo.urn%22%3E%0A%0A++++++++%3Ckennis%3E+%0A++++++++++%3Ctagg%3Aa%3E%0A++++++++++++%3Caanhef%3Aa%3EMevr+%3C%2Faanhef%3Aa%3E%0A++++++++++++%3Cpersoon%3E%0A++++++++++++++++%3Cvoornaam%3Aa%3ECaro%3C%2Fvoornaam%3Aa%3E%0A++++++++++++++++%3Cachternaam%3Aa%3EEmerald+gaat%3C%2Fachternaam%3Aa%3E%0A++++++++++++++++%3Chobby%3Aa%3E+graag+zingen+%3C%2Fhobby%3Aa%3E%0A++++++++++++%3C%2Fpersoon%3E%0A++++++++++%3C%2Ftagg%3Aa%3E%0A++++++++%3C%2Fkennis%3E%0A++++++++%3Ckennis%3E%0A++++++++++%3Ctagg%3Ab%3E%0A++++++++++++%3Caanhef%3Ab%3EDhr+%3C%2Faanhef%3Ab%3E%0A++++++++++++%3Cpersoon%3E%0A++++++++++++++++%3Cvoornaam%3Ab%3EBas%3C%2Fvoornaam%3Ab%3E%0A++++++++++++++++%3Cachternaam%3Ab%3Evan+de+Ven%3C%2Fachternaam%3Ab%3E%0A++++++++++++++++%3Chobby%3Ab%3E+drummen+%3C%2Fhobby%3Ab%3E%0A++++++++++++%3C%2Fpersoon%3E%0A++++++++++%3C%2Ftagg%3Ab%3E%0A++++++++%3C%2Fkennis%3E+%0A++++++++%3Ckennis%3E%0A++++++++++%3Ctagg%3Ac%3E%0A++++++++++++%3Caanhef%3Ac%3EJongeman+%3C%2Faanhef%3Ac%3E%0A++++++++++++%3Cpersoon%3E%0A++++++++++++++++%3Cvoornaam%3Ac%3ERuben%3C%2Fvoornaam%3Ac%3E%0A++++++++++++++++%3Cachternaam%3Ac%3EVerhoeven%3C%2Fachternaam%3Ac%3E%0A++++++++++++++++%3Chobby%3Ac%3E+voetballen+%3C%2Fhobby%3Ac%3E%0A++++++++++++%3C%2Fpersoon%3E%0A++++++++++%3C%2Ftagg%3Ac%3E%0A++++++++%3C%2Fkennis%3E+%0A%0A%3C%2Fvoorbeeld%3E'
   42     1        NEW                                              $10     'SimplexmlElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $10
   44     5        FETCH_OBJ_R                                      ~13     !1, 'kennis'
          6      > FE_RESET_R                                       $14     ~13, ->68
          7    > > FE_FETCH_R                                               $14, !2, ->68
   45     8    >   INIT_METHOD_CALL                                         !2, 'children'
          9        SEND_VAL_EX                                              'verbinding'
         10        DO_FCALL                                      0  $15     
         11        ASSIGN                                                   !3, $15
   46    12        INIT_METHOD_CALL                                         !3, 'children'
         13        SEND_VAL_EX                                              'doorgang'
         14        DO_FCALL                                      0  $17     
         15        ASSIGN                                                   !4, $17
   48    16        FETCH_OBJ_R                                      ~19     !3, 'a'
         17        CONCAT                                           ~20     'De+aanhef+is+%3A+', ~19
         18        FETCH_OBJ_R                                      ~21     !4, 'a'
         19        CONCAT                                           ~22     ~20, ~21
         20        ECHO                                                     ~22
   49    21        FETCH_OBJ_R                                      ~23     !3, 'b'
         22        FETCH_OBJ_R                                      ~24     !4, 'b'
         23        CONCAT                                           ~25     ~23, ~24
         24        ECHO                                                     ~25
   50    25        FETCH_OBJ_R                                      ~26     !3, 'c'
         26        FETCH_OBJ_R                                      ~27     !4, 'c'
         27        CONCAT                                           ~28     ~26, ~27
         28        ECHO                                                     ~28
   52    29        FETCH_OBJ_R                                      ~29     !3, 'persoon'
         30      > FE_RESET_R                                       $30     ~29, ->65
         31    > > FE_FETCH_R                                               $30, !5, ->65
   54    32    >   INIT_METHOD_CALL                                         !5, 'children'
         33        SEND_VAL_EX                                              'verwijzing'
         34        DO_FCALL                                      0  $31     
         35        ASSIGN                                                   !6, $31
   55    36        INIT_METHOD_CALL                                         !5, 'children'
         37        SEND_VAL_EX                                              'brug'
         38        DO_FCALL                                      0  $33     
         39        ASSIGN                                                   !7, $33
   56    40        INIT_METHOD_CALL                                         !5, 'children'
         41        SEND_VAL_EX                                              'my.foo.urn'
         42        DO_FCALL                                      0  $35     
         43        ASSIGN                                                   !8, $35
   59    44        FETCH_OBJ_R                                      ~37     !3, 'a'
         45        FETCH_OBJ_R                                      ~38     !4, 'a'
         46        CONCAT                                           ~39     ~37, ~38
         47        FETCH_OBJ_R                                      ~40     !6, 'a'
         48        CONCAT                                           ~41     ~39, ~40
         49        FETCH_OBJ_R                                      ~42     !7, 'a'
         50        CONCAT                                           ~43     ~41, ~42
         51        FETCH_OBJ_R                                      ~44     !8, 'a'
         52        CONCAT                                           ~45     ~43, ~44
         53        ECHO                                                     ~45
   60    54        FETCH_OBJ_R                                      ~46     !3, 'b'
         55        FETCH_OBJ_R                                      ~47     !4, 'b'
         56        CONCAT                                           ~48     ~46, ~47
         57        FETCH_OBJ_R                                      ~49     !6, 'b'
         58        CONCAT                                           ~50     ~48, ~49
         59        FETCH_OBJ_R                                      ~51     !7, 'b'
         60        CONCAT                                           ~52     ~50, ~51
         61        FETCH_OBJ_R                                      ~53     !8, 'b'
         62        CONCAT                                           ~54     ~52, ~53
         63        ECHO                                                     ~54
   52    64      > JMP                                                      ->31
         65    >   FE_FREE                                                  $30
   65    66        ECHO                                                     '%3Cbr%2F%3E'
   44    67      > JMP                                                      ->7
         68    >   FE_FREE                                                  $14
   68    69        ECHO                                                     '%3Cbr%3E'
         70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.38 ms | 1403 KiB | 13 Q