|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-12-28 07:36 UTC] alex at passant dot org
Description:
------------
When a string contains \\, json_decode returns no result (while \/ works fine).
Reproduce code:
---------------
{
"head": {
"vars": ["site", "name"]
},
"results": {
"distinct": true,
"bindings": [
{
"site": { "type": "uri", "value": "http://b4mad.net/datenbrei/" },
"name": { "type": "literal", "value": "B:\\datenbrei" }
}
]
}
}
Expected result:
----------------
stdClass Object
(
[head] => stdClass Object
(
[vars] => Array
(
[0] => site
[1] => name
)
)
[results] => stdClass Object
(
[distinct] => 1
[bindings] => Array
(
[0] => stdClass Object
(
[site] => stdClass Object
(
[type] => uri
[value] => http://b4mad.net/datenbrei/
)
[name] => stdClass Object
(
[type] => literal
[value] => B:\datenbrei
)
)
)
)
)
Actual result:
--------------
None
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 00:00:01 2025 UTC |
I can't reproduce this with 5.2.6. <?php $a = array('name' => 'B:\datenbrei'); var_dump(json_encode($a)); var_dump(json_decode(json_encode($a))); ?> Produces string(24) "{"name":"B:\\datenbrei"}" object(stdClass)#1 (1) { ["name"]=> string(12) "B:\datenbrei" }