3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = "This is some data It has some new lines in it Look, there's some more"; var_dump($data); $json = json_encode($data); var_dump($json); var_dump(json_decode($json));
based on ps8Lc
Output for 5.2.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(70) "This is some data It has some new lines in it Look, there's some more" string(75) ""This is some data\nIt has some new lines in it\n\nLook, there's some more"" string(70) "This is some data It has some new lines in it Look, there's some more"
Output for 5.2.1
string(70) "This is some data It has some new lines in it Look, there's some more" string(75) ""This is some data\nIt has some new lines in it\n\nLook, there's some more"" string(73) "This is some data\nIt has some new lines in it\n\nLook, there's some more"
Output for 5.2.0
string(70) "This is some data It has some new lines in it Look, there's some more" string(75) ""This is some data\nIt has some new lines in it\n\nLook, there's some more"" NULL
Output for 5.0.0 - 5.1.6
string(70) "This is some data It has some new lines in it Look, there's some more" Fatal error: Call to undefined function json_encode() in /in/k05be on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
string(70) "This is some data It has some new lines in it Look, there's some more" Fatal error: Call to undefined function: json_encode() in /in/k05be on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
string(70) "This is some data It has some new lines in it Look, there's some more" Fatal error: Call to undefined function: json_encode() in /in/k05be on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
string(70) "This is some data It has some new lines in it Look, there's some more" Fatal error: Call to undefined function: json_encode() in /in/k05be on line 9