3v4l.org

run code in 300+ PHP versions simultaneously
<?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!"; echo $authors;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: Array to string conversion in /in/Woa33 on line 20 Array
Output for 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Notice: Array to string conversion in /in/Woa33 on line 20 Array
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 7.3.32 - 7.3.33
Array
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/Woa33 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/Woa33 on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/Woa33 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/Woa33 on line 10

preferences:
254.4 ms | 401 KiB | 306 Q