3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $json = '{ "id": -1, "name": "All", "children": [ { "id": "default", "name": "default", "isDefault": true, "children": [ { "id": "AUDCAD", "name": "AUDCAD", "leaf": true }, { "id": "AUDCHF", "name": "AUDCHF", "leaf": true }, { "id": "AUDNZD", "name": "AUDNZD", "leaf": true }, { "id": "AUDSGD", "name": "AUDSGD", "leaf": true }, { "id": "AUDUSD", "name": "AUDUSD", "leaf": true }, { "id": "CADCHF", "name": "CADCHF", "leaf": true }, { "id": "CADHKD", "name": "CADHKD", "leaf": true }, { "id": "CADJPY", "name": "CADJPY", "leaf": true }, { "id": "CHFJPY", "name": "CHFJPY", "leaf": true }, { "id": "CHFSGD", "name": "CHFSGD", "leaf": true }, { "id": "EURAUD", "name": "EURAUD", "leaf": true }, { "id": "EURCHF", "name": "EURCHF", "leaf": true }, { "id": "EURDKK", "name": "EURDKK", "leaf": true }, { "id": "EURGBP", "name": "EURGBP", "leaf": true }, { "id": "EURHKD", "name": "EURHKD", "leaf": true }, { "id": "EURJPY", "name": "EURJPY", "leaf": true }, { "id": "EURNOK", "name": "EURNOK", "leaf": true }, { "id": "EURNZD", "name": "EURNZD", "leaf": true }, { "id": "EURPLN", "name": "EURPLN", "leaf": true }, { "id": "EURRUB", "name": "EURRUB", "leaf": true }, { "id": "EURSEK", "name": "EURSEK", "leaf": true }, { "id": "EURSGD", "name": "EURSGD", "leaf": true }, { "id": "EURTRY", "name": "EURTRY", "leaf": true }, { "id": "EURUSD", "name": "EURUSD", "leaf": true }, { "id": "EURZAR", "name": "EURZAR", "leaf": true }, { "id": "GBPAUD", "name": "GBPAUD", "leaf": true }, { "id": "GBPCAD", "name": "GBPCAD", "leaf": true }, { "id": "GBPCHF", "name": "GBPCHF", "leaf": true }, { "id": "GBPJPY", "name": "GBPJPY", "leaf": true }, { "id": "GBPNZD", "name": "GBPNZD", "leaf": true }, { "id": "GBPTRY", "name": "GBPTRY", "leaf": true }, { "id": "GBPUSD", "name": "GBPUSD", "leaf": true }, { "id": "HKDJPY", "name": "HKDJPY", "leaf": true }, { "id": "NZDCAD", "name": "NZDCAD", "leaf": true }, { "id": "NZDCHF", "name": "NZDCHF", "leaf": true }, { "id": "NZDJPY", "name": "NZDJPY", "leaf": true }, { "id": "NZDUSD", "name": "NZDUSD", "leaf": true }, { "id": "SGDJPY", "name": "SGDJPY", "leaf": true }, { "id": "USDCAD", "name": "USDCAD", "leaf": true }, { "id": "USDCHF", "name": "USDCHF", "leaf": true }, { "id": "USDCNH", "name": "USDCNH", "leaf": true }, { "id": "USDDKK", "name": "USDDKK", "leaf": true }, { "id": "USDHKD", "name": "USDHKD", "leaf": true }, { "id": "USDJPY", "name": "USDJPY", "leaf": true }, { "id": "USDMXN", "name": "USDMXN", "leaf": true }, { "id": "USDNOK", "name": "USDNOK", "leaf": true }, { "id": "USDPLN", "name": "USDPLN", "leaf": true }, { "id": "USDRUB", "name": "USDRUB", "leaf": true }, { "id": "USDRUR", "name": "USDRUR", "leaf": true }, { "id": "USDSEK", "name": "USDSEK", "leaf": true }, { "id": "USDSGD", "name": "USDSGD", "leaf": true }, { "id": "USDTRY", "name": "USDTRY", "leaf": true }, { "id": "USDZAR", "name": "USDZAR", "leaf": true }, { "id": "XAGUSD", "name": "XAGUSD", "leaf": true }, { "id": "XAUUSD", "name": "XAUUSD", "leaf": true } ] }, { "id": "\u0442\u0435\u0441\u0442", "name": "\u0442\u0435\u0441\u0442", "isDefault": false, "children": [ { "id": "AUDJPY", "name": "AUDJPY", "leaf": true }, { "id": "EURCAD", "name": "EURCAD", "leaf": true } ] } ], "success": true }'; var_dump(json_decode($json,true));
based on E06VK
Output for 5.2.0 - 7.2.0
array(4) { ["id"]=> int(-1) ["name"]=> string(3) "All" ["children"]=> array(2) { [0]=> array(4) { ["id"]=> string(7) "default" ["name"]=> string(7) "default" ["isDefault"]=> bool(true) ["children"]=> array(55) { [0]=> array(3) { ["id"]=> string(6) "AUDCAD" ["name"]=> string(6) "AUDCAD" ["leaf"]=> bool(true) } [1]=> array(3) { ["id"]=> string(6) "AUDCHF" ["name"]=> string(6) "AUDCHF" ["leaf"]=> bool(true) } [2]=> array(3) { ["id"]=> string(6) "AUDNZD" ["name"]=> string(6) "AUDNZD" ["leaf"]=> bool(true) } [3]=> array(3) { ["id"]=> string(6) "AUDSGD" ["name"]=> string(6) "AUDSGD" ["leaf"]=> bool(true) } [4]=> array(3) { ["id"]=> string(6) "AUDUSD" ["name"]=> string(6) "AUDUSD" ["leaf"]=> bool(true) } [5]=> array(3) { ["id"]=> string(6) "CADCHF" ["name"]=> string(6) "CADCHF" ["leaf"]=> bool(true) } [6]=> array(3) { ["id"]=> string(6) "CADHKD" ["name"]=> string(6) "CADHKD" ["leaf"]=> bool(true) } [7]=> array(3) { ["id"]=> string(6) "CADJPY" ["name"]=> string(6) "CADJPY" ["leaf"]=> bool(true) } [8]=> array(3) { ["id"]=> string(6) "CHFJPY" ["name"]=> string(6) "CHFJPY" ["leaf"]=> bool(true) } [9]=> array(3) { ["id"]=> string(6) "CHFSGD" ["name"]=> string(6) "CHFSGD" ["leaf"]=> bool(true) } [10]=> array(3) { ["id"]=> string(6) "EURAUD" ["name"]=> string(6) "EURAUD" ["leaf"]=> bool(true) } [11]=> array(3) { ["id"]=> string(6) "EURCHF" ["name"]=> string(6) "EURCHF" ["leaf"]=> bool(true) } [12]=> array(3) { ["id"]=> string(6) "EURDKK" ["name"]=> string(6) "EURDKK" ["leaf"]=> bool(true) } [13]=> array(3) { ["id"]=> string(6) "EURGBP" ["name"]=> string(6) "EURGBP" ["leaf"]=> bool(true) } [14]=> array(3) { ["id"]=> string(6) "EURHKD" ["name"]=> string(6) "EURHKD" ["leaf"]=> bool(true) } [15]=> array(3) { ["id"]=> string(6) "EURJPY" ["name"]=> string(6) "EURJPY" ["leaf"]=> bool(true) } [16]=> array(3) { ["id"]=> string(6) "EURNOK" ["name"]=> string(6) "EURNOK" ["leaf"]=> bool(true) } [17]=> array(3) { ["id"]=> string(6) "EURNZD" ["name"]=> string(6) "EURNZD" ["leaf"]=> bool(true) } [18]=> array(3) { ["id"]=> string(6) "EURPLN" ["name"]=> string(6) "EURPLN" ["leaf"]=> bool(true) } [19]=> array(3) { ["id"]=> string(6) "EURRUB" ["name"]=> string(6) "EURRUB" ["leaf"]=> bool(true) } [20]=> array(3) { ["id"]=> string(6) "EURSEK" ["name"]=> string(6) "EURSEK" ["leaf"]=> bool(true) } [21]=> array(3) { ["id"]=> string(6) "EURSGD" ["name"]=> string(6) "EURSGD" ["leaf"]=> bool(true) } [22]=> array(3) { ["id"]=> string(6) "EURTRY" ["name"]=> string(6) "EURTRY" ["leaf"]=> bool(true) } [23]=> array(3) { ["id"]=> string(6) "EURUSD" ["name"]=> string(6) "EURUSD" ["leaf"]=> bool(true) } [24]=> array(3) { ["id"]=> string(6) "EURZAR" ["name"]=> string(6) "EURZAR" ["leaf"]=> bool(true) } [25]=> array(3) { ["id"]=> string(6) "GBPAUD" ["name"]=> string(6) "GBPAUD" ["leaf"]=> bool(true) } [26]=> array(3) { ["id"]=> string(6) "GBPCAD" ["name"]=> string(6) "GBPCAD" ["leaf"]=> bool(true) } [27]=> array(3) { ["id"]=> string(6) "GBPCHF" ["name"]=> string(6) "GBPCHF" ["leaf"]=> bool(true) } [28]=> array(3) { ["id"]=> string(6) "GBPJPY" ["name"]=> string(6) "GBPJPY" ["leaf"]=> bool(true) } [29]=> array(3) { ["id"]=> string(6) "GBPNZD" ["name"]=> string(6) "GBPNZD" ["leaf"]=> bool(true) } [30]=> array(3) { ["id"]=> string(6) "GBPTRY" ["name"]=> string(6) "GBPTRY" ["leaf"]=> bool(true) } [31]=> array(3) { ["id"]=> string(6) "GBPUSD" ["name"]=> string(6) "GBPUSD" ["leaf"]=> bool(true) } [32]=> array(3) { ["id"]=> string(6) "HKDJPY" ["name"]=> string(6) "HKDJPY" ["leaf"]=> bool(true) } [33]=> array(3) { ["id"]=> string(6) "NZDCAD" ["name"]=> string(6) "NZDCAD" ["leaf"]=> bool(true) } [34]=> array(3) { ["id"]=> string(6) "NZDCHF" ["name"]=> string(6) "NZDCHF" ["leaf"]=> bool(true) } [35]=> array(3) { ["id"]=> string(6) "NZDJPY" ["name"]=> string(6) "NZDJPY" ["leaf"]=> bool(true) } [36]=> array(3) { ["id"]=> string(6) "NZDUSD" ["name"]=> string(6) "NZDUSD" ["leaf"]=> bool(true) } [37]=> array(3) { ["id"]=> string(6) "SGDJPY" ["name"]=> string(6) "SGDJPY" ["leaf"]=> bool(true) } [38]=> array(3) { ["id"]=> string(6) "USDCAD" ["name"]=> string(6) "USDCAD" ["leaf"]=> bool(true) } [39]=> array(3) { ["id"]=> string(6) "USDCHF" ["name"]=> string(6) "USDCHF" ["leaf"]=> bool(true) } [40]=> array(3) { ["id"]=> string(6) "USDCNH" ["name"]=> string(6) "USDCNH" ["leaf"]=> bool(true) } [41]=> array(3) { ["id"]=> string(6) "USDDKK" ["name"]=> string(6) "USDDKK" ["leaf"]=> bool(true) } [42]=> array(3) { ["id"]=> string(6) "USDHKD" ["name"]=> string(6) "USDHKD" ["leaf"]=> bool(true) } [43]=> array(3) { ["id"]=> string(6) "USDJPY" ["name"]=> string(6) "USDJPY" ["leaf"]=> bool(true) } [44]=> array(3) { ["id"]=> string(6) "USDMXN" ["name"]=> string(6) "USDMXN" ["leaf"]=> bool(true) } [45]=> array(3) { ["id"]=> string(6) "USDNOK" ["name"]=> string(6) "USDNOK" ["leaf"]=> bool(true) } [46]=> array(3) { ["id"]=> string(6) "USDPLN" ["name"]=> string(6) "USDPLN" ["leaf"]=> bool(true) } [47]=> array(3) { ["id"]=> string(6) "USDRUB" ["name"]=> string(6) "USDRUB" ["leaf"]=> bool(true) } [48]=> array(3) { ["id"]=> string(6) "USDRUR" ["name"]=> string(6) "USDRUR" ["leaf"]=> bool(true) } [49]=> array(3) { ["id"]=> string(6) "USDSEK" ["name"]=> string(6) "USDSEK" ["leaf"]=> bool(true) } [50]=> array(3) { ["id"]=> string(6) "USDSGD" ["name"]=> string(6) "USDSGD" ["leaf"]=> bool(true) } [51]=> array(3) { ["id"]=> string(6) "USDTRY" ["name"]=> string(6) "USDTRY" ["leaf"]=> bool(true) } [52]=> array(3) { ["id"]=> string(6) "USDZAR" ["name"]=> string(6) "USDZAR" ["leaf"]=> bool(true) } [53]=> array(3) { ["id"]=> string(6) "XAGUSD" ["name"]=> string(6) "XAGUSD" ["leaf"]=> bool(true) } [54]=> array(3) { ["id"]=> string(6) "XAUUSD" ["name"]=> string(6) "XAUUSD" ["leaf"]=> bool(true) } } } [1]=> array(4) { ["id"]=> string(8) "тест" ["name"]=> string(8) "тест" ["isDefault"]=> bool(false) ["children"]=> array(2) { [0]=> array(3) { ["id"]=> string(6) "AUDJPY" ["name"]=> string(6) "AUDJPY" ["leaf"]=> bool(true) } [1]=> array(3) { ["id"]=> string(6) "EURCAD" ["name"]=> string(6) "EURCAD" ["leaf"]=> bool(true) } } } } ["success"]=> bool(true) }
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/m6P62 on line 308
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/m6P62 on line 308
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/m6P62 on line 308
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/m6P62 on line 308