3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $json = array( "sn" => CAS0510000072, "name" => 内网测试环境, "engine" => array( "pkt_uri" => "https://192.168.1.224:7088/engine/fred.tar.gz", "md5" => "e6e21fc448db4a5a57087df0060b8292", "title" => "fred" ), "area" => array( "pkt_uri" => "https://192.168.1.224:7088/area/东南地区_beta.tar.gz", "md5" => "4b6570bdae1fee83ef5ff2ab725eed4e", "title" => "东南地区_beta" ), "account" => array( "pkt_uri" => "https://192.168.1.224:7088/account.conf", "md5" => "481284bd6c5a0481c1f1b32afd7c8aae", "title" => "account" ), "work" => "start" ); $encoded = json_encode($json); var_dump($encoded); $unescaped = preg_replace_callback('/\\\u(\w{4})/', function ($matches) { return html_entity_decode('&#x' . $matches[1] . ';', ENT_COMPAT, 'UTF-8'); }, $encoded); echo $unescaped;
based on fjOKd
Output for 7.2.0
Warning: Use of undefined constant CAS0510000072 - assumed 'CAS0510000072' (this will throw an Error in a future version of PHP) in /in/hKiNg on line 4 Warning: Use of undefined constant 内网测试环境 - assumed '内网测试环境' (this will throw an Error in a future version of PHP) in /in/hKiNg on line 5 string(513) "{"sn":"CAS0510000072","name":"\u5185\u7f51\u6d4b\u8bd5\u73af\u5883","engine":{"pkt_uri":"https:\/\/192.168.1.224:7088\/engine\/fred.tar.gz","md5":"e6e21fc448db4a5a57087df0060b8292","title":"fred"},"area":{"pkt_uri":"https:\/\/192.168.1.224:7088\/area\/\u4e1c\u5357\u5730\u533a_beta.tar.gz","md5":"4b6570bdae1fee83ef5ff2ab725eed4e","title":"\u4e1c\u5357\u5730\u533a_beta"},"account":{"pkt_uri":"https:\/\/192.168.1.224:7088\/account.conf","md5":"481284bd6c5a0481c1f1b32afd7c8aae","title":"account"},"work":"start"}" {"sn":"CAS0510000072","name":"内网测试环境","engine":{"pkt_uri":"https:\/\/192.168.1.224:7088\/engine\/fred.tar.gz","md5":"e6e21fc448db4a5a57087df0060b8292","title":"fred"},"area":{"pkt_uri":"https:\/\/192.168.1.224:7088\/area\/东南地区_beta.tar.gz","md5":"4b6570bdae1fee83ef5ff2ab725eed4e","title":"东南地区_beta"},"account":{"pkt_uri":"https:\/\/192.168.1.224:7088\/account.conf","md5":"481284bd6c5a0481c1f1b32afd7c8aae","title":"account"},"work":"start"}
Output for 5.5.0 - 7.1.10
Notice: Use of undefined constant CAS0510000072 - assumed 'CAS0510000072' in /in/hKiNg on line 4 Notice: Use of undefined constant 内网测试环境 - assumed '内网测试环境' in /in/hKiNg on line 5 string(513) "{"sn":"CAS0510000072","name":"\u5185\u7f51\u6d4b\u8bd5\u73af\u5883","engine":{"pkt_uri":"https:\/\/192.168.1.224:7088\/engine\/fred.tar.gz","md5":"e6e21fc448db4a5a57087df0060b8292","title":"fred"},"area":{"pkt_uri":"https:\/\/192.168.1.224:7088\/area\/\u4e1c\u5357\u5730\u533a_beta.tar.gz","md5":"4b6570bdae1fee83ef5ff2ab725eed4e","title":"\u4e1c\u5357\u5730\u533a_beta"},"account":{"pkt_uri":"https:\/\/192.168.1.224:7088\/account.conf","md5":"481284bd6c5a0481c1f1b32afd7c8aae","title":"account"},"work":"start"}" {"sn":"CAS0510000072","name":"内网测试环境","engine":{"pkt_uri":"https:\/\/192.168.1.224:7088\/engine\/fred.tar.gz","md5":"e6e21fc448db4a5a57087df0060b8292","title":"fred"},"area":{"pkt_uri":"https:\/\/192.168.1.224:7088\/area\/东南地区_beta.tar.gz","md5":"4b6570bdae1fee83ef5ff2ab725eed4e","title":"东南地区_beta"},"account":{"pkt_uri":"https:\/\/192.168.1.224:7088\/account.conf","md5":"481284bd6c5a0481c1f1b32afd7c8aae","title":"account"},"work":"start"}