3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $cur = '{"base":"GBP","date":"2015-07-10","rates":{"AUD":2.0776,"BGN":2.7134,"BRL":4.9426,"CAD":1.9717,"CHF":1.4517,"CNY":9.6354,"CZK":37.629,"DKK":10.353,"HKD":12.028,"HRK":10.513,"HUF":431.48,"IDR":20618.02,"ILS":5.8442,"INR":98.381,"JPY":189.9,"KRW":1748.58,"MXN":24.375,"MYR":5.8873,"NOK":12.348,"NZD":2.2988,"PHP":69.989,"PLN":5.793,"RON":6.1662,"RUB":87.457,"SEK":13.055,"SGD":2.0914,"THB":52.651,"TRY":4.1337,"USD":1.5517,"ZAR":19.26,"EUR":1.3873}}'; $currency = json_decode($cur,true); var_dump($currency);
based on h3Chu
Output for 5.2.0 - 7.3.0rc4
array(3) { ["base"]=> string(3) "GBP" ["date"]=> string(10) "2015-07-10" ["rates"]=> array(31) { ["AUD"]=> float(2.0776) ["BGN"]=> float(2.7134) ["BRL"]=> float(4.9426) ["CAD"]=> float(1.9717) ["CHF"]=> float(1.4517) ["CNY"]=> float(9.6354) ["CZK"]=> float(37.629) ["DKK"]=> float(10.353) ["HKD"]=> float(12.028) ["HRK"]=> float(10.513) ["HUF"]=> float(431.48) ["IDR"]=> float(20618.02) ["ILS"]=> float(5.8442) ["INR"]=> float(98.381) ["JPY"]=> float(189.9) ["KRW"]=> float(1748.58) ["MXN"]=> float(24.375) ["MYR"]=> float(5.8873) ["NOK"]=> float(12.348) ["NZD"]=> float(2.2988) ["PHP"]=> float(69.989) ["PLN"]=> float(5.793) ["RON"]=> float(6.1662) ["RUB"]=> float(87.457) ["SEK"]=> float(13.055) ["SGD"]=> float(2.0914) ["THB"]=> float(52.651) ["TRY"]=> float(4.1337) ["USD"]=> float(1.5517) ["ZAR"]=> float(19.26) ["EUR"]=> float(1.3873) } }
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/7Zbuj on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/7Zbuj on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/7Zbuj on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/7Zbuj on line 5