3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml_string = <<<EOX <?xml version="1.0" encoding="UTF-8"?> <gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref"> <gesmes:subject>Reference rates</gesmes:subject> <gesmes:Sender> <gesmes:name>European Central Bank</gesmes:name> </gesmes:Sender> <Cube> <Cube time='2013-08-23'> <Cube currency='USD' rate='1.3355'/> <Cube currency='GBP' rate='0.85910'/> <Cube currency='HUF' rate='298.98'/> </Cube> </Cube> </gesmes:Envelope> EOX; $tak = file_get_contents('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); $xml = simplexml_load_string($tak); $xml->registerXPathNamespace('c', 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref'); $result = $xml->xpath('//c:Cube[@currency="USD"]'); echo var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/06A9u
function name:  (null)
number of ops:  22
compiled vars:  !0 = $xml_string, !1 = $tak, !2 = $xml, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Cgesmes%3AEnvelope+xmlns%3Agesmes%3D%22http%3A%2F%2Fwww.gesmes.org%2Fxml%2F2002-08-01%22+xmlns%3D%22http%3A%2F%2Fwww.ecb.int%2Fvocabulary%2F2002-08-01%2Feurofxref%22%3E%0A++++%3Cgesmes%3Asubject%3EReference+rates%3C%2Fgesmes%3Asubject%3E%0A++++%3Cgesmes%3ASender%3E%0A++++++++%3Cgesmes%3Aname%3EEuropean+Central+Bank%3C%2Fgesmes%3Aname%3E%0A++++%3C%2Fgesmes%3ASender%3E%0A++++%3CCube%3E%0A++++++++%3CCube+time%3D%272013-08-23%27%3E%0A++++++++++++%3CCube+currency%3D%27USD%27+rate%3D%271.3355%27%2F%3E%0A++++++++++++%3CCube+currency%3D%27GBP%27+rate%3D%270.85910%27%2F%3E%0A++++++++++++%3CCube+currency%3D%27HUF%27+rate%3D%27298.98%27%2F%3E%0A++++++++%3C%2FCube%3E%0A++++%3C%2FCube%3E%0A%3C%2Fgesmes%3AEnvelope%3E'
   20     1        INIT_FCALL                                               'file_get_contents'
          2        SEND_VAL                                                 'http%3A%2F%2Fwww.ecb.europa.eu%2Fstats%2Feurofxref%2Feurofxref-daily.xml'
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   22     5        INIT_FCALL                                               'simplexml_load_string'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !2, $7
   24     9        INIT_METHOD_CALL                                         !2, 'registerXPathNamespace'
         10        SEND_VAL_EX                                              'c'
         11        SEND_VAL_EX                                              'http%3A%2F%2Fwww.ecb.int%2Fvocabulary%2F2002-08-01%2Feurofxref'
         12        DO_FCALL                                      0          
   25    13        INIT_METHOD_CALL                                         !2, 'xpath'
         14        SEND_VAL_EX                                              '%2F%2Fc%3ACube%5B%40currency%3D%22USD%22%5D'
         15        DO_FCALL                                      0  $10     
         16        ASSIGN                                                   !3, $10
   27    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $12     
         20        ECHO                                                     $12
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.64 ms | 1396 KiB | 19 Q