3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"foo": "lorem `bar` ipsum"}'; echo 'Without str_replace()' . PHP_EOL; var_dump(json_decode($json, true)); echo PHP_EOL; echo 'With your current str_replace()' . PHP_EOL; var_dump(json_decode(str_replace('`', '"', $json), true)); echo PHP_EOL; echo 'With esceped str_replace()' . PHP_EOL; var_dump(json_decode(str_replace('`', '\"', $json), true));
Output for git.master, git.master_jit, rfc.property-hooks
Without str_replace() array(1) { ["foo"]=> string(17) "lorem `bar` ipsum" } With your current str_replace() NULL With esceped str_replace() array(1) { ["foo"]=> string(17) "lorem "bar" ipsum" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
163.27 ms | 405 KiB | 5 Q