3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Gengi { function __construct($currency=null) { $this->url = "http://api02.gengi.is/currency/"; if ( !is_null( $currency ) ): $this->url .= $currency; endif; $this->curr = $currency; } public function request() { $result = file_get_contents($this->url); var_dump(json_decode($result,true)); } } $orig = "{query}"; $gengi = new Gengi($orig); $json = $gengi->request();

preferences:
37.76 ms | 402 KiB | 5 Q