3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //Source: https://bugs.php.net/bug.php?id=63898 $key = "Foo "; $array = array($key => "ñí"); print_r($array); $json = json_encode($array); echo $json."\n"; print_r(json_decode($json));
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [Foo ] => ñí ) {"Foo ":"\u00f1\u00ed"} stdClass Object ( [Foo ] => ñí )
Output for 5.0.0 - 5.1.6
Array ( [Foo ] => ñí ) Fatal error: Call to undefined function json_encode() in /in/fd941 on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Array ( [Foo ] => ñí ) Fatal error: Call to undefined function: json_encode() in /in/fd941 on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Array ( [Foo ] => ñí ) Fatal error: Call to undefined function: json_encode() in /in/fd941 on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Array ( [Foo ] => ñí ) Fatal error: Call to undefined function: json_encode() in /in/fd941 on line 9