[php-src] Issue #22527: Unterminated JSON strings are misleadingly reported as “Control character error”
| From: | TimWolla | Date: | Tue, 30 Jun 2026 10:17:29 +0000 |
| Subject: | [php-src] Issue #22527: Unterminated JSON strings are misleadingly reported as “Control character error” | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-252318@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/22527
Author: TimWolla
### Description
The following code:
```php
<?php
var_dump(json_decode('"'), json_last_error_msg());
```
Resulted in this output:
```
NULL
string(53) "Control character error, possibly incorrectly encoded"
```
But I expected this output instead: Something about EOF being reached.
### PHP Version
```plain
PHP 8.5.7 (cli) (built: Jun 6 2026 05:36:56) (NTS)
Copyright (c) The PHP Group
Built by Ubuntu
Zend Engine v4.5.7, Copyright (c) Zend Technologies
with Zend OPcache v8.5.7, Copyright (c), by Zend Technologies
```
### Operating System
_No response_