|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-31 05:34 UTC] rasmus@php.net
-Status: Open
+Status: Bogus
[2010-07-31 05:34 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 17:00:01 2025 UTC |
Description: ------------ In particular, "{\"test\": [\"\n\"]}" doesn't give the correct result. Examples follow. Test script: --------------- <?php $a = "{\"test\": [\"\n\"]}"; echo "$a\r\n"; var_dump(json_decode($a, true)); ?> Expected result: ---------------- I would expect an array to be output. ie. array(1) { ["test"]=> array(1) { [0]=> string(1) " " } } Certainly javascript has no problem with it: <script src="http://github.com/kvz/phpjs/raw/master/functions/strings/echo.js"></script> <script src="http://github.com/kvz/phpjs/raw/master/functions/var/var_dump.js"></script> <script> a = {"test": ["\n"]}; var_dump(a); </script> Actual result: -------------- NULL