[php-src] Issue #8602: Json_decode removes a \ from \\ as object or associative array
| From: | remco-pc | Date: | Sat, 21 May 2022 23:31:22 +0000 |
| Subject: | [php-src] Issue #8602: Json_decode removes a \ from \\ as object or associative array | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241570@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8602
Author: remco-pc
### Description
The following code:
```php
<?php
```
$read = '{"test" : "te\\\\st"}';
json_decode($read);
Resulted in this output:
```
object(stdClass)#658 (1) {
--
| ["test"]=>
| string(5) "te\st"
| }
```
But I expected this output instead:
```
object(stdClass)#658 (1) {
--
| ["test"]=>
| string(5) "te\\st"
| }
```
### PHP Version
7.4.28
### Operating System
Debian 11.2