3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = "test\n123"; var_dump($data); $json = json_encode($data); var_dump($json); $data2 = json_decode($data); var_dump($data2); $json2 = json_encode($data); var_dump($json2);
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
string(8) "test 123" string(11) ""test\n123"" NULL string(11) ""test\n123""