3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ReadXml($xmlstr) { $xml = new \SimpleXmlElement($xmlstr); $result = $xml->getName() . PHP_EOL; foreach ($xml as $child) { $result .= $child->getName() . ': ' . $child . PHP_EOL; } return $result; } $xmlstr= '<Address><to>James</to><from>Jani</from><heading>Reminder</heading><body>Please check your mail.</body></Address>'; ReadXml($xmlstr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ctDhZ
function name:  (null)
number of ops:  5
compiled vars:  !0 = $xmlstr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     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'
   17     1        INIT_FCALL                                               'readxml'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

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

End of function readxml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.23 ms | 1399 KiB | 14 Q