3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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); }
Output for 5.3.0 - 5.4.29
Parse error: syntax error, unexpected '=' in /in/jYQNZ on line 19
Process exited with code 255.