3v4l.org

run code in 300+ PHP versions simultaneously
<?php $XML=simplexml_load_file("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"); //the file is updated daily between 8:15AM and 9AM EDT $usd = 0; $currencyCodes = array(); $result = 0; foreach($XML->Cube->Cube->Cube as $rate){ if($rate["currency"] == "USD"){ $usd = $rate["rate"]; } $currencyCodes[] = $rate; } foreach($currencyCodes as $rate){ echo sprintf("INSERT INTO `interdesign`.`currency_conversion` (`code`, `per_eur`, `per_usd`) VALUES ('%s', '%s', '%s');<br>", $rate["currency"], $rate["rate"], $usd ? $rate["rate"]/$usd : NULL); $result += DBRef::idb()->exec($qry); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 17
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 45
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 45
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 34
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
Branch analysis from position: 20
filename:       /in/o8nJt
function name:  (null)
number of ops:  47
compiled vars:  !0 = $XML, !1 = $usd, !2 = $currencyCodes, !3 = $result, !4 = $rate, !5 = $qry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'simplexml_load_file'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.ecb.europa.eu%2Fstats%2Feurofxref%2Feurofxref-daily.xml'
          2        DO_ICALL                                         $6      
          3        ASSIGN                                                   !0, $6
    7     4        ASSIGN                                                   !1, 0
    8     5        ASSIGN                                                   !2, <array>
    9     6        ASSIGN                                                   !3, 0
   11     7        FETCH_OBJ_R                                      ~11     !0, 'Cube'
          8        FETCH_OBJ_R                                      ~12     ~11, 'Cube'
          9        FETCH_OBJ_R                                      ~13     ~12, 'Cube'
         10      > FE_RESET_R                                       $14     ~13, ->20
         11    > > FE_FETCH_R                                               $14, !4, ->20
   12    12    >   FETCH_DIM_R                                      ~15     !4, 'currency'
         13        IS_EQUAL                                                 ~15, 'USD'
         14      > JMPZ                                                     ~16, ->17
   13    15    >   FETCH_DIM_R                                      ~17     !4, 'rate'
         16        ASSIGN                                                   !1, ~17
   15    17    >   ASSIGN_DIM                                               !2
         18        OP_DATA                                                  !4
   11    19      > JMP                                                      ->11
         20    >   FE_FREE                                                  $14
   18    21      > FE_RESET_R                                       $20     !2, ->45
         22    > > FE_FETCH_R                                               $20, !4, ->45
   19    23    >   INIT_FCALL                                               'sprintf'
         24        SEND_VAL                                                 'INSERT+INTO+%60interdesign%60.%60currency_conversion%60+%28%60code%60%2C+%60per_eur%60%2C+%60per_usd%60%29+VALUES+%28%27%25s%27%2C+%27%25s%27%2C+%27%25s%27%29%3B%3Cbr%3E'
   20    25        FETCH_DIM_R                                      ~21     !4, 'currency'
         26        SEND_VAL                                                 ~21
   21    27        FETCH_DIM_R                                      ~22     !4, 'rate'
         28        SEND_VAL                                                 ~22
   22    29      > JMPZ                                                     !1, ->34
         30    >   FETCH_DIM_R                                      ~23     !4, 'rate'
         31        DIV                                              ~24     ~23, !1
         32        QM_ASSIGN                                        ~25     ~24
         33      > JMP                                                      ->35
         34    >   QM_ASSIGN                                        ~25     null
         35    >   SEND_VAL                                                 ~25
         36        DO_ICALL                                         $26     
         37        ECHO                                                     $26
   24    38        INIT_STATIC_METHOD_CALL                                  'DBRef', 'idb'
         39        DO_FCALL                                      0  $27     
         40        INIT_METHOD_CALL                                         $27, 'exec'
         41        SEND_VAR_EX                                              !5
         42        DO_FCALL                                      0  $28     
         43        ASSIGN_OP                                     1          !3, $28
   18    44      > JMP                                                      ->22
         45    >   FE_FREE                                                  $20
   25    46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.39 ms | 1400 KiB | 17 Q