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 h0Jcf
Output for 5.2.0 - 7.2.6
object(stdClass)#1 (4) { ["id"]=> int(-1) ["name"]=> string(3) "All" ["children"]=> array(2) { [0]=> object(stdClass)#2 (4) { ["id"]=> string(7) "default" ["name"]=> string(7) "default" ["isDefault"]=> bool(true) ["children"]=> array(55) { [0]=> object(stdClass)#3 (3) { ["id"]=> string(6) "AUDCAD" ["name"]=> string(6) "AUDCAD" ["leaf"]=> bool(true) } [1]=> object(stdClass)#4 (3) { ["id"]=> string(6) "AUDCHF" ["name"]=> string(6) "AUDCHF" ["leaf"]=> bool(true) } [2]=> object(stdClass)#5 (3) { ["id"]=> string(6) "AUDNZD" ["name"]=> string(6) "AUDNZD" ["leaf"]=> bool(true) } [3]=> object(stdClass)#6 (3) { ["id"]=> string(6) "AUDSGD" ["name"]=> string(6) "AUDSGD" ["leaf"]=> bool(true) } [4]=> object(stdClass)#7 (3) { ["id"]=> string(6) "AUDUSD" ["name"]=> string(6) "AUDUSD" ["leaf"]=> bool(true) } [5]=> object(stdClass)#8 (3) { ["id"]=> string(6) "CADCHF" ["name"]=> string(6) "CADCHF" ["leaf"]=> bool(true) } [6]=> object(stdClass)#9 (3) { ["id"]=> string(6) "CADHKD" ["name"]=> string(6) "CADHKD" ["leaf"]=> bool(true) } [7]=> object(stdClass)#10 (3) { ["id"]=> string(6) "CADJPY" ["name"]=> string(6) "CADJPY" ["leaf"]=> bool(true) } [8]=> object(stdClass)#11 (3) { ["id"]=> string(6) "CHFJPY" ["name"]=> string(6) "CHFJPY" ["leaf"]=> bool(true) } [9]=> object(stdClass)#12 (3) { ["id"]=> string(6) "CHFSGD" ["name"]=> string(6) "CHFSGD" ["leaf"]=> bool(true) } [10]=> object(stdClass)#13 (3) { ["id"]=> string(6) "EURAUD" ["name"]=> string(6) "EURAUD" ["leaf"]=> bool(true) } [11]=> object(stdClass)#14 (3) { ["id"]=> string(6) "EURCHF" ["name"]=> string(6) "EURCHF" ["leaf"]=> bool(true) } [12]=> object(stdClass)#15 (3) { ["id"]=> string(6) "EURDKK" ["name"]=> string(6) "EURDKK" ["leaf"]=> bool(true) } [13]=> object(stdClass)#16 (3) { ["id"]=> string(6) "EURGBP" ["name"]=> string(6) "EURGBP" ["leaf"]=> bool(true) } [14]=> object(stdClass)#17 (3) { ["id"]=> string(6) "EURHKD" ["name"]=> string(6) "EURHKD" ["leaf"]=> bool(true) } [15]=> object(stdClass)#18 (3) { ["id"]=> string(6) "EURJPY" ["name"]=> string(6) "EURJPY" ["leaf"]=> bool(true) } [16]=> object(stdClass)#19 (3) { ["id"]=> string(6) "EURNOK" ["name"]=> string(6) "EURNOK" ["leaf"]=> bool(true) } [17]=> object(stdClass)#20 (3) { ["id"]=> string(6) "EURNZD" ["name"]=> string(6) "EURNZD" ["leaf"]=> bool(true) } [18]=> object(stdClass)#21 (3) { ["id"]=> string(6) "EURPLN" ["name"]=> string(6) "EURPLN" ["leaf"]=> bool(true) } [19]=> object(stdClass)#22 (3) { ["id"]=> string(6) "EURRUB" ["name"]=> string(6) "EURRUB" ["leaf"]=> bool(true) } [20]=> object(stdClass)#23 (3) { ["id"]=> string(6) "EURSEK" ["name"]=> string(6) "EURSEK" ["leaf"]=> bool(true) } [21]=> object(stdClass)#24 (3) { ["id"]=> string(6) "EURSGD" ["name"]=> string(6) "EURSGD" ["leaf"]=> bool(true) } [22]=> object(stdClass)#25 (3) { ["id"]=> string(6) "EURTRY" ["name"]=> string(6) "EURTRY" ["leaf"]=> bool(true) } [23]=> object(stdClass)#26 (3) { ["id"]=> string(6) "EURUSD" ["name"]=> string(6) "EURUSD" ["leaf"]=> bool(true) } [24]=> object(stdClass)#27 (3) { ["id"]=> string(6) "EURZAR" ["name"]=> string(6) "EURZAR" ["leaf"]=> bool(true) } [25]=> object(stdClass)#28 (3) { ["id"]=> string(6) "GBPAUD" ["name"]=> string(6) "GBPAUD" ["leaf"]=> bool(true) } [26]=> object(stdClass)#29 (3) { ["id"]=> string(6) "GBPCAD" ["name"]=> string(6) "GBPCAD" ["leaf"]=> bool(true) } [27]=> object(stdClass)#30 (3) { ["id"]=> string(6) "GBPCHF" ["name"]=> string(6) "GBPCHF" ["leaf"]=> bool(true) } [28]=> object(stdClass)#31 (3) { ["id"]=> string(6) "GBPJPY" ["name"]=> string(6) "GBPJPY" ["leaf"]=> bool(true) } [29]=> object(stdClass)#32 (3) { ["id"]=> string(6) "GBPNZD" ["name"]=> string(6) "GBPNZD" ["leaf"]=> bool(true) } [30]=> object(stdClass)#33 (3) { ["id"]=> string(6) "GBPTRY" ["name"]=> string(6) "GBPTRY" ["leaf"]=> bool(true) } [31]=> object(stdClass)#34 (3) { ["id"]=> string(6) "GBPUSD" ["name"]=> string(6) "GBPUSD" ["leaf"]=> bool(true) } [32]=> object(stdClass)#35 (3) { ["id"]=> string(6) "HKDJPY" ["name"]=> string(6) "HKDJPY" ["leaf"]=> bool(true) } [33]=> object(stdClass)#36 (3) { ["id"]=> string(6) "NZDCAD" ["name"]=> string(6) "NZDCAD" ["leaf"]=> bool(true) } [34]=> object(stdClass)#37 (3) { ["id"]=> string(6) "NZDCHF" ["name"]=> string(6) "NZDCHF" ["leaf"]=> bool(true) } [35]=> object(stdClass)#38 (3) { ["id"]=> string(6) "NZDJPY" ["name"]=> string(6) "NZDJPY" ["leaf"]=> bool(true) } [36]=> object(stdClass)#39 (3) { ["id"]=> string(6) "NZDUSD" ["name"]=> string(6) "NZDUSD" ["leaf"]=> bool(true) } [37]=> object(stdClass)#40 (3) { ["id"]=> string(6) "SGDJPY" ["name"]=> string(6) "SGDJPY" ["leaf"]=> bool(true) } [38]=> object(stdClass)#41 (3) { ["id"]=> string(6) "USDCAD" ["name"]=> string(6) "USDCAD" ["leaf"]=> bool(true) } [39]=> object(stdClass)#42 (3) { ["id"]=> string(6) "USDCHF" ["name"]=> string(6) "USDCHF" ["leaf"]=> bool(true) } [40]=> object(stdClass)#43 (3) { ["id"]=> string(6) "USDCNH" ["name"]=> string(6) "USDCNH" ["leaf"]=> bool(true) } [41]=> object(stdClass)#44 (3) { ["id"]=> string(6) "USDDKK" ["name"]=> string(6) "USDDKK" ["leaf"]=> bool(true) } [42]=> object(stdClass)#45 (3) { ["id"]=> string(6) "USDHKD" ["name"]=> string(6) "USDHKD" ["leaf"]=> bool(true) } [43]=> object(stdClass)#46 (3) { ["id"]=> string(6) "USDJPY" ["name"]=> string(6) "USDJPY" ["leaf"]=> bool(true) } [44]=> object(stdClass)#47 (3) { ["id"]=> string(6) "USDMXN" ["name"]=> string(6) "USDMXN" ["leaf"]=> bool(true) } [45]=> object(stdClass)#48 (3) { ["id"]=> string(6) "USDNOK" ["name"]=> string(6) "USDNOK" ["leaf"]=> bool(true) } [46]=> object(stdClass)#49 (3) { ["id"]=> string(6) "USDPLN" ["name"]=> string(6) "USDPLN" ["leaf"]=> bool(true) } [47]=> object(stdClass)#50 (3) { ["id"]=> string(6) "USDRUB" ["name"]=> string(6) "USDRUB" ["leaf"]=> bool(true) } [48]=> object(stdClass)#51 (3) { ["id"]=> string(6) "USDRUR" ["name"]=> string(6) "USDRUR" ["leaf"]=> bool(true) } [49]=> object(stdClass)#52 (3) { ["id"]=> string(6) "USDSEK" ["name"]=> string(6) "USDSEK" ["leaf"]=> bool(true) } [50]=> object(stdClass)#53 (3) { ["id"]=> string(6) "USDSGD" ["name"]=> string(6) "USDSGD" ["leaf"]=> bool(true) } [51]=> object(stdClass)#54 (3) { ["id"]=> string(6) "USDTRY" ["name"]=> string(6) "USDTRY" ["leaf"]=> bool(true) } [52]=> object(stdClass)#55 (3) { ["id"]=> string(6) "USDZAR" ["name"]=> string(6) "USDZAR" ["leaf"]=> bool(true) } [53]=> object(stdClass)#56 (3) { ["id"]=> string(6) "XAGUSD" ["name"]=> string(6) "XAGUSD" ["leaf"]=> bool(true) } [54]=> object(stdClass)#57 (3) { ["id"]=> string(6) "XAUUSD" ["name"]=> string(6) "XAUUSD" ["leaf"]=> bool(true) } } } [1]=> object(stdClass)#58 (4) { ["id"]=> string(8) "тест" ["name"]=> string(8) "тест" ["isDefault"]=> bool(false) ["children"]=> array(2) { [0]=> object(stdClass)#59 (3) { ["id"]=> string(6) "AUDJPY" ["name"]=> string(6) "AUDJPY" ["leaf"]=> bool(true) } [1]=> object(stdClass)#60 (3) { ["id"]=> string(6) "EURCAD" ["name"]=> string(6) "EURCAD" ["leaf"]=> bool(true) } } } } ["success"]=> bool(true) } bool(true)
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/L1BnG 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/L1BnG 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/L1BnG 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/L1BnG on line 308