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 => "qñíq"); 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 ] => qñíq ) {"Foo ":"q\u00f1\u00edq"} stdClass Object ( [Foo ] => qñíq )
Output for 5.0.0 - 5.1.6
Array ( [Foo ] => qñíq ) Fatal error: Call to undefined function json_encode() in /in/Nh7R1 on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Array ( [Foo ] => qñíq ) Fatal error: Call to undefined function: json_encode() in /in/Nh7R1 on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Array ( [Foo ] => qñíq ) Fatal error: Call to undefined function: json_encode() in /in/Nh7R1 on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Array ( [Foo ] => qñíq ) Fatal error: Call to undefined function: json_encode() in /in/Nh7R1 on line 9