3v4l.org

run code in 300+ PHP versions simultaneously
<?php $XMLContent=file("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"); //the file is updated daily between 2.15 p.m. and 3.00 p.m. CET foreach($XMLContent as $line){ if(preg_match("/currency='([[:alpha:]]+)'/",$line,$currencyCode)){ if(preg_match("/rate='([[:graph:]]+)'/",$line,$rate)){ //Output the value of 1EUR for a currency code echo'1&euro;='.$rate[1].' '.$currencyCode[1].'<br/>'; //-------------------------------------------------- //Here you can add your code for inserting //$rate[1] and $currencyCode[1] into your database //-------------------------------------------------- } } } ?>
Output for git.master, git.master_jit
Warning: file(): php_network_getaddresses: getaddrinfo for www.ecb.europa.eu failed: System error in /in/A1rvZ on line 2 Warning: file(http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml): Failed to open stream: php_network_getaddresses: getaddrinfo for www.ecb.europa.eu failed: System error in /in/A1rvZ on line 2 Warning: foreach() argument must be of type array|object, bool given in /in/A1rvZ on line 5
Output for rfc.property-hooks
Warning: file(): php_network_getaddresses: getaddrinfo for www.ecb.europa.eu failed: System error in /in/A1rvZ on line 2 Warning: file(http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml): Failed to open stream: php_network_getaddresses: getaddrinfo for www.ecb.europa.eu failed: System error in /in/A1rvZ on line 2 Warning: foreach() argument must be of type array|object, false given in /in/A1rvZ on line 5

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.04 ms | 401 KiB | 8 Q