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; $xml = simplexml_load_string(file_get_contents('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml')); $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/OBnZ6
function name:  (null)
number of ops:  21
compiled vars:  !0 = $xml_string, !1 = $xml, !2 = $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                                               'simplexml_load_string'
          2        INIT_FCALL                                               'file_get_contents'
          3        SEND_VAL                                                 'http%3A%2F%2Fwww.ecb.europa.eu%2Fstats%2Feurofxref%2Feurofxref-daily.xml'
          4        DO_ICALL                                         $4      
          5        SEND_VAR                                                 $4
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !1, $5
   22     8        INIT_METHOD_CALL                                         !1, 'registerXPathNamespace'
          9        SEND_VAL_EX                                              'c'
         10        SEND_VAL_EX                                              'http%3A%2F%2Fwww.ecb.int%2Fvocabulary%2F2002-08-01%2Feurofxref'
         11        DO_FCALL                                      0          
   23    12        INIT_METHOD_CALL                                         !1, 'xpath'
         13        SEND_VAL_EX                                              '%2F%2Fc%3ACube%5B%40currency%3D%22USD%22%5D'
         14        DO_FCALL                                      0  $8      
         15        ASSIGN                                                   !2, $8
   25    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $10     
         19        ECHO                                                     $10
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.65 ms | 1396 KiB | 19 Q