|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57412 Escaped chars not unescaped
Submitted: 2006-12-01 13:13 UTC Modified: 2008-12-18 21:35 UTC
From: jan at horde dot org Assigned:
Status: Not a bug Package: json (PECL)
PHP Version: 5_2 CVS-2006-12-01 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jan at horde dot org
New email:
PHP Version: OS:


 [2006-12-01 13:13 UTC] jan at horde dot org
json_decode() doesn't unescaped escaped characters like tabs, newlines, carriage returns etc. and doesn't understand single quotes.
A patch for 001.phpt (PHP_5_2 branch) is available at

Reproduce code:

Expected result:
string(13) "hello	"world""
string(4) "blah"

Actual result:
string(16) "hello\t\"world\""
string(6) "'blah'"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-18 21:35 UTC]
The first one works correctly in 5.2.6 but the second is not 
valid JSON, it should be
"'blah'" or "blah"
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Sep 29 20:03:56 2022 UTC