3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlstr = '<Address><to>James</to><from>Jani</from><heading>Reminder</heading><body>Please check your mail.</body></Address>'; $element = simplexml_load_string($xmlstr); echo $element->getName(); foreach($element->children() as $key => $child) { echo $key."-".$child."\n"; } var_dump();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/FRDKk
function name:  (null)
number of ops:  22
compiled vars:  !0 = $xmlstr, !1 = $element, !2 = $child, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3CAddress%3E%3Cto%3EJames%3C%2Fto%3E%3Cfrom%3EJani%3C%2Ffrom%3E%3Cheading%3EReminder%3C%2Fheading%3E%3Cbody%3EPlease+check+your+mail.%3C%2Fbody%3E%3C%2FAddress%3E'
    5     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    6     5        INIT_METHOD_CALL                                         !1, 'getName'
          6        DO_FCALL                                      0  $7      
          7        ECHO                                                     $7
    8     8        INIT_METHOD_CALL                                         !1, 'children'
          9        DO_FCALL                                      0  $8      
         10      > FE_RESET_R                                       $9      $8, ->18
         11    > > FE_FETCH_R                                       ~10     $9, !2, ->18
         12    >   ASSIGN                                                   !3, ~10
    9    13        CONCAT                                           ~12     !3, '-'
         14        CONCAT                                           ~13     ~12, !2
         15        CONCAT                                           ~14     ~13, '%0A'
         16        ECHO                                                     ~14
    8    17      > JMP                                                      ->11
         18    >   FE_FREE                                                  $9
   11    19        INIT_FCALL                                               'var_dump'
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.94 ms | 1395 KiB | 17 Q