3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $User = array( 'Name' => "Hans-Peterµµ", 'Contacts' => array(1, 2, 3, 4, 5, 6, 7, 42), 'Active' => 1 ); $JS = json_encode($User, JSON_UNESCAPED_UNICODE); $J = json_encode($User); echo $J."<br/>\r\n".$JS;
based on 8SubP
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
{"Name":"Hans-Peter\u00b5\u00b5","Contacts":[1,2,3,4,5,6,7,42],"Active":1}<br/> {"Name":"Hans-Peterµµ","Contacts":[1,2,3,4,5,6,7,42],"Active":1}
Output for 5.3.0 - 5.3.29
Notice: Use of undefined constant JSON_UNESCAPED_UNICODE - assumed 'JSON_UNESCAPED_UNICODE' in /in/CSCVY on line 7 Warning: json_encode() expects parameter 2 to be long, string given in /in/CSCVY on line 7 {"Name":"Hans-Peter\u00b5\u00b5","Contacts":[1,2,3,4,5,6,7,42],"Active":1}<br/>
Output for 5.2.0 - 5.2.17
Notice: Use of undefined constant JSON_UNESCAPED_UNICODE - assumed 'JSON_UNESCAPED_UNICODE' in /in/CSCVY on line 7 Warning: json_encode() expects exactly 1 parameter, 2 given in /in/CSCVY on line 7 {"Name":"Hans-Peter\u00b5\u00b5","Contacts":[1,2,3,4,5,6,7,42],"Active":1}<br/>
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/CSCVY on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/CSCVY on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_encode() in /in/CSCVY on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_encode() in /in/CSCVY on line 7