3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ReadXml($xmlstr) { $xml = simplexml_load_string($xmlstr); foreach($xml as $key=>$val) { print $key; if(!empty($val)) print ':' . $val; } } $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/PYcoH
function name:  (null)
number of ops:  5
compiled vars:  !0 = $xmlstr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     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'
   13     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 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/PYcoH
function name:  ReadXml
number of ops:  17
compiled vars:  !0 = $xmlstr, !1 = $xml, !2 = $val, !3 = $key
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                                         $4      
          4        ASSIGN                                                   !1, $4
    5     5      > FE_RESET_R                                       $6      !1, ->15
          6    > > FE_FETCH_R                                       ~7      $6, !2, ->15
          7    >   ASSIGN                                                   !3, ~7
    6     8        ECHO                                                     !3
    7     9        ISSET_ISEMPTY_CV                                 ~9      !2
         10        BOOL_NOT                                         ~10     ~9
         11      > JMPZ                                                     ~10, ->14
         12    >   CONCAT                                           ~11     '%3A', !2
         13        ECHO                                                     ~11
    5    14    > > JMP                                                      ->6
         15    >   FE_FREE                                                  $6
    9    16      > RETURN                                                   null

End of function readxml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.51 ms | 1399 KiB | 16 Q