3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function authorstatsReadJSON() { $json = '{"authors":{"jon":{"C":105,"E":470,"e":0,"D":0,"R":1,"pm":{"201208":70,"201407":29,"201310":177,"201309":65,"201211":7,"201210":12,"201312":4,"201409":4,"201308":8,"201305":1,"201303":116,"201403":4,"201311":27,"201404":1,"201402":2,"201406":1,"201302":5,"201207":22,"201212":4,"201209":14,"201304":2}},"nick":{"C":8,"E":56,"e":0,"D":0,"R":0,"pm":{"201208":10,"201404":2,"201312":2,"201310":9,"201211":2,"201205":9,"201204":8,"201207":5,"201206":10,"201210":3,"201209":1,"201407":2}},"oksana":{"C":1,"E":23,"e":0,"D":1,"R":1,"pm":{"201407":4,"201403":7,"201402":3,"201312":4,"201309":3,"201211":3,"201209":1}},"john":{"C":57,"E":202,"e":0,"D":2,"R":0,"pm":{"201407":22,"201403":10,"201310":11,"201309":21,"201308":10,"201302":7,"201212":7,"201201":12,"201207":22,"201303":27,"201210":15,"201408":4,"201405":6,"201406":2,"201206":38,"201205":24,"201312":1,"201311":6,"201208":4,"201204":6,"201301":2,"201209":2,"201401":1}},"tbrine":{"C":8,"E":56,"e":0,"D":1,"R":5,"pm":{"201406":17,"201408":4,"201310":15,"201407":8,"201405":11,"201404":1,"201309":12,"201307":1}},"mthompson":{"C":1,"E":9,"e":0,"D":1,"R":0,"pm":{"201309":7,"201310":3}},"mark":{"C":21,"E":118,"e":0,"D":1,"R":0,"pm":{"201304":4,"201212":5,"201208":10,"201204":32,"201201":2,"201209":3,"201211":11,"201210":10,"201205":17,"201309":5,"201207":19,"201301":3,"201401":1,"201206":12,"201302":2,"201203":3}},"eddie":{"C":4,"E":43,"e":9,"D":0,"R":0,"pm":{"201309":5,"201407":26,"201408":3,"201310":18,"201403":1,"201404":1,"201311":1}},"marks":{"C":18,"E":323,"e":7,"D":2,"R":5,"pm":{"201310":18,"201312":6,"201211":16,"201303":100,"201304":14,"201305":22,"201302":24,"201308":5,"201405":11,"201404":2,"201403":12,"201309":25,"201409":21,"201205":5,"201210":11,"201209":11,"201203":5,"201406":11,"201207":3,"201208":5,"201301":8,"201206":9,"201204":4,"201407":4,"201401":2}},"joao":{"C":0,"E":6,"e":0,"D":0,"R":0,"pm":{"201210":2,"201211":3}},"admin":{"C":4,"E":8,"e":0,"D":1,"R":0,"pm":{"201201":12}},"harald":{"C":5,"E":27,"e":0,"D":1,"R":0,"pm":{"201405":18,"201310":1,"201306":1,"201304":5,"201309":3,"201303":1,"201302":2,"201401":1}},"jhebb":{"C":2,"E":19,"e":0,"D":0,"R":0,"pm":{"201404":16,"201403":1,"201309":3}},"damian":{"C":4,"E":57,"e":0,"D":1,"R":0,"pm":{"201408":11,"201409":20,"201407":30}},"frank":{"C":0,"E":5,"e":0,"D":0,"R":0,"pm":{"201407":4}},"alex":{"C":1,"E":7,"e":0,"D":0,"R":0,"pm":{"201407":7}},"rob":{"C":0,"E":2,"e":0,"D":0,"R":0,"pm":{"201407":1}},"saurabh":{"C":0,"E":2,"e":0,"D":0,"R":0,"pm":{"201407":1}},"rudy":{"C":0,"E":16,"e":0,"D":0,"R":0,"pm":{"201211":3,"201209":7,"201208":1,"201207":2,"201206":2}}},"lastchange":"1410259105"}'; //var_dump(json_decode($json)); //var_dump(json_decode($json, true)); $output = json_decode($json, true); return $output; } $tmp = authorstatsReadJSON(); //var_dump($tmp); $authors = $tmp; if (!$authors) return "There are no stats to output!"; var_dump($authors);
based on Woa33
Output for 5.2.0 - 7.1.0
array(2) { ["authors"]=> array(19) { ["jon"]=> array(6) { ["C"]=> int(105) ["E"]=> int(470) ["e"]=> int(0) ["D"]=> int(0) ["R"]=> int(1) ["pm"]=> array(21) { [201208]=> int(70) [201407]=> int(29) [201310]=> int(177) [201309]=> int(65) [201211]=> int(7) [201210]=> int(12) [201312]=> int(4) [201409]=> int(4) [201308]=> int(8) [201305]=> int(1) [201303]=> int(116) [201403]=> int(4) [201311]=> int(27) [201404]=> int(1) [201402]=> int(2) [201406]=> int(1) [201302]=> int(5) [201207]=> int(22) [201212]=> int(4) [201209]=> int(14) [201304]=> int(2) } } ["nick"]=> array(6) { ["C"]=> int(8) ["E"]=> int(56) ["e"]=> int(0) ["D"]=> int(0) ["R"]=> int(0) ["pm"]=> array(12) { [201208]=> int(10) [201404]=> int(2) [201312]=> int(2) [201310]=> int(9) [201211]=> int(2) [201205]=> int(9) [201204]=> int(8) [201207]=> int(5) [201206]=> int(10) [201210]=> int(3) [201209]=> int(1) [201407]=> int(2) } } ["oksana"]=> array(6) { ["C"]=> int(1) ["E"]=> int(23) ["e"]=> int(0) ["D"]=> int(1) ["R"]=> int(1) ["pm"]=> array(7) { [201407]=> int(4) [201403]=> int(7) [201402]=> int(3) [201312]=> int(4) [201309]=> int(3) [201211]=> int(3) [201209]=> int(1) } } ["john"]=> array(6) { ["C"]=> int(57) ["E"]=> int(202) ["e"]=> int(0) ["D"]=> int(2) ["R"]=> int(0) ["pm"]=> array(23) { [201407]=> int(22) [201403]=> int(10) [201310]=> int(11) [201309]=> int(21) [201308]=> int(10) [201302]=> int(7) [201212]=> int(7) [201201]=> int(12) [201207]=> int(22) [201303]=> int(27) [201210]=> int(15) [201408]=> int(4) [201405]=> int(6) [201406]=> int(2) [201206]=> int(38) [201205]=> int(24) [201312]=> int(1) [201311]=> int(6) [201208]=> int(4) [201204]=> int(6) [201301]=> int(2) [201209]=> int(2) [201401]=> int(1) } } ["tbrine"]=> array(6) { ["C"]=> int(8) ["E"]=> int(56) ["e"]=> int(0) ["D"]=> int(1) ["R"]=> int(5) ["pm"]=> array(8) { [201406]=> int(17) [201408]=> int(4) [201310]=> int(15) [201407]=> int(8) [201405]=> int(11) [201404]=> int(1) [201309]=> int(12) [201307]=> int(1) } } ["mthompson"]=> array(6) { ["C"]=> int(1) ["E"]=> int(9) ["e"]=> int(0) ["D"]=> int(1) ["R"]=> int(0) ["pm"]=> array(2) { [201309]=> int(7) [201310]=> int(3) } } ["mark"]=> array(6) { ["C"]=> int(21) ["E"]=> int(118) ["e"]=> int(0) ["D"]=> int(1) ["R"]=> int(0) ["pm"]=> array(16) { [201304]=> int(4) [201212]=> int(5) [201208]=> int(10) [201204]=> int(32) [201201]=> int(2) [201209]=> int(3) [201211]=> int(11) [201210]=> int(10) [201205]=> int(17) [201309]=> int(5) [201207]=> int(19) [201301]=> int(3) [201401]=> int(1) [201206]=> int(12) [201302]=> int(2) [201203]=> int(3) } } ["eddie"]=> array(6) { ["C"]=> int(4) ["E"]=> int(43) ["e"]=> int(9) ["D"]=> int(0) ["R"]=> int(0) ["pm"]=> array(7) { [201309]=> int(5) [201407]=> int(26) [201408]=> int(3) [201310]=> int(18) [201403]=> int(1) [201404]=> int(1) [201311]=> int(1) } } ["marks"]=> array(6) { ["C"]=> int(18) ["E"]=> int(323) ["e"]=> int(7) ["D"]=> int(2) ["R"]=> int(5) ["pm"]=> array(25) { [201310]=> int(18) [201312]=> int(6) [201211]=> int(16) [201303]=> int(100) [201304]=> int(14) [201305]=> int(22) [201302]=> int(24) [201308]=> int(5) [201405]=> int(11) [201404]=> int(2) [201403]=> int(12) [201309]=> int(25) [201409]=> int(21) [201205]=> int(5) [201210]=> int(11) [201209]=> int(11) [201203]=> int(5) [201406]=> int(11) [201207]=> int(3) [201208]=> int(5) [201301]=> int(8) [201206]=> int(9) [201204]=> int(4) [201407]=> int(4) [201401]=> int(2) } } ["joao"]=> array(6) { ["C"]=> int(0) ["E"]=> int(6) ["e"]=> int(0) ["D"]=> int(0) ["R"]=> int(0) ["pm"]=> array(2) { [201210]=> int(2) [201211]=> int(3) } } ["admin"]=> array(6) { ["C"]=> int(4) ["E"]=> int(8) ["e"]=> int(0) ["D"]=> int(1) ["R"]=> int(0) ["pm"]=> array(1) { [201201]=> int(12) } } ["harald"]=> array(6) { ["C"]=> int(5) ["E"]=> int(27) ["e"]=> int(0) ["D"]=> int(1) ["R"]=> int(0) ["pm"]=> array(8) { [201405]=> int(18) [201310]=> int(1) [201306]=> int(1) [201304]=> int(5) [201309]=> int(3) [201303]=> int(1) [201302]=> int(2) [201401]=> int(1) } } ["jhebb"]=> array(6) { ["C"]=> int(2) ["E"]=> int(19) ["e"]=> int(0) ["D"]=> int(0) ["R"]=> int(0) ["pm"]=> array(3) { [201404]=> int(16) [201403]=> int(1) [201309]=> int(3) } } ["damian"]=> array(6) { ["C"]=> int(4) ["E"]=> int(57) ["e"]=> int(0) ["D"]=> int(1) ["R"]=> int(0) ["pm"]=> array(3) { [201408]=> int(11) [201409]=> int(20) [201407]=> int(30) } } ["frank"]=> array(6) { ["C"]=> int(0) ["E"]=> int(5) ["e"]=> int(0) ["D"]=> int(0) ["R"]=> int(0) ["pm"]=> array(1) { [201407]=> int(4) } } ["alex"]=> array(6) { ["C"]=> int(1) ["E"]=> int(7) ["e"]=> int(0) ["D"]=> int(0) ["R"]=> int(0) ["pm"]=> array(1) { [201407]=> int(7) } } ["rob"]=> array(6) { ["C"]=> int(0) ["E"]=> int(2) ["e"]=> int(0) ["D"]=> int(0) ["R"]=> int(0) ["pm"]=> array(1) { [201407]=> int(1) } } ["saurabh"]=> array(6) { ["C"]=> int(0) ["E"]=> int(2) ["e"]=> int(0) ["D"]=> int(0) ["R"]=> int(0) ["pm"]=> array(1) { [201407]=> int(1) } } ["rudy"]=> array(6) { ["C"]=> int(0) ["E"]=> int(16) ["e"]=> int(0) ["D"]=> int(0) ["R"]=> int(0) ["pm"]=> array(5) { [201211]=> int(3) [201209]=> int(7) [201208]=> int(1) [201207]=> int(2) [201206]=> int(2) } } } ["lastchange"]=> string(10) "1410259105" }
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/SBmPQ on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/SBmPQ on line 10
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/SBmPQ on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/SBmPQ on line 10