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 ); $J = json_encode($User); $JS = json_encode($User, JSON_UNESCAPED_UNICODE); echo $JS."<br/>\r\n".$J; //echo $JS."--".json_decode($JS)."__";
based on 2SSvi
Output for 5.4.0 - 7.1.0
{"Name":"Hans-Peterµµ","Contacts":[1,2,3,4,5,6,7,42],"Active":1}<br/> {"Name":"Hans-Peter\u00b5\u00b5","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/8SubP on line 8 Warning: json_encode() expects parameter 2 to be long, string given in /in/8SubP on line 8 <br/> {"Name":"Hans-Peter\u00b5\u00b5","Contacts":[1,2,3,4,5,6,7,42],"Active":1}
Output for 5.2.0 - 5.2.17
Notice: Use of undefined constant JSON_UNESCAPED_UNICODE - assumed 'JSON_UNESCAPED_UNICODE' in /in/8SubP on line 8 Warning: json_encode() expects exactly 1 parameter, 2 given in /in/8SubP on line 8 <br/> {"Name":"Hans-Peter\u00b5\u00b5","Contacts":[1,2,3,4,5,6,7,42],"Active":1}
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/8SubP on line 7
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/8SubP on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/8SubP 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/8SubP 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/8SubP on line 7