3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dec = json_decode('{"a":"A\u2028B"}'); $dec = json_encode($dec, JSON_UNESCAPED_UNICODE | ); $json = $dec; $json = strtr( $json, array( "\xE2\x80\xA8" => '1', // \u2028 "\xE2\x80\xA9" => '2', // \u2029 ) ); var_dump($json); var_dump($dec); echo strlen($json), ' ', strlen($dec);
Output for 5.3.0 - 5.4.30
Parse error: syntax error, unexpected ')' in /in/s2BqP on line 4
Process exited with code 255.