3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ReadXml($str) { $xml = simplexml_load_string($str); echo $xml->getName() . "\n"; foreach($xml->children() as $parent) { echo $parent->getName() . ': ' . $parent . "\n"; } } ReadXml('<Address><to>James</to><from>Jani</from><heading>Reminder</heading><body>Please check your mail.</body></Address>');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mKiS1
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'readxml'
          1        SEND_VAL                                                 '%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'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function readxml:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 20
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/mKiS1
function name:  ReadXml
number of ops:  22
compiled vars:  !0 = $str, !1 = $xml, !2 = $parent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
    5     5        INIT_METHOD_CALL                                         !1, 'getName'
          6        DO_FCALL                                      0  $5      
          7        CONCAT                                           ~6      $5, '%0A'
          8        ECHO                                                     ~6
    6     9        INIT_METHOD_CALL                                         !1, 'children'
         10        DO_FCALL                                      0  $7      
         11      > FE_RESET_R                                       $8      $7, ->20
         12    > > FE_FETCH_R                                               $8, !2, ->20
    8    13    >   INIT_METHOD_CALL                                         !2, 'getName'
         14        DO_FCALL                                      0  $9      
         15        CONCAT                                           ~10     $9, '%3A+'
         16        CONCAT                                           ~11     ~10, !2
         17        CONCAT                                           ~12     ~11, '%0A'
         18        ECHO                                                     ~12
    6    19      > JMP                                                      ->12
         20    >   FE_FREE                                                  $8
   10    21      > RETURN                                                   null

End of function readxml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.44 ms | 1390 KiB | 16 Q