3v4l.org

run code in 300+ PHP versions simultaneously
<?php function StartElement($parser, $name, $attrs) { if (!empty($attrs['RATE'])) { echo "1&euro;=".$attrs['RATE']." ".$attrs['CURRENCY']."<br />"; } } $xml_parser= xml_parser_create(); xml_set_element_handler($xml_parser, "StartElement", ""); // for the following command you will need file_get_contents (PHP >= 4.3.0) // and the config option allow_url_fopen=On (default) xml_parse($xml_parser, file_get_contents ("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml")); xml_parser_free($xml_parser); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AhIOW
function name:  (null)
number of ops:  19
compiled vars:  !0 = $xml_parser
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'xml_parser_create'
          1        DO_ICALL                                         $1      
          2        ASSIGN                                                   !0, $1
    8     3        INIT_FCALL                                               'xml_set_element_handler'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 'StartElement'
          6        SEND_VAL                                                 ''
          7        DO_ICALL                                                 
   11     8        INIT_FCALL                                               'xml_parse'
          9        SEND_VAR                                                 !0
         10        INIT_FCALL                                               'file_get_contents'
         11        SEND_VAL                                                 'http%3A%2F%2Fwww.ecb.europa.eu%2Fstats%2Feurofxref%2Feurofxref-daily.xml'
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                                 
   12    15        INIT_FCALL                                               'xml_parser_free'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
   13    18      > RETURN                                                   1

Function startelement:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/AhIOW
function name:  StartElement
number of ops:  14
compiled vars:  !0 = $parser, !1 = $name, !2 = $attrs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    3     3        ISSET_ISEMPTY_DIM_OBJ                         1  ~3      !2, 'RATE'
          4        BOOL_NOT                                         ~4      ~3
          5      > JMPZ                                                     ~4, ->13
    4     6    >   FETCH_DIM_R                                      ~5      !2, 'RATE'
          7        CONCAT                                           ~6      '1%26euro%3B%3D', ~5
          8        CONCAT                                           ~7      ~6, '+'
          9        FETCH_DIM_R                                      ~8      !2, 'CURRENCY'
         10        CONCAT                                           ~9      ~7, ~8
         11        CONCAT                                           ~10     ~9, '%3Cbr+%2F%3E'
         12        ECHO                                                     ~10
    6    13    > > RETURN                                                   null

End of function startelement

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.76 ms | 1396 KiB | 23 Q