Title: Unterminated JSON strings are misleadingly reported as “Control character error” · Issue #22527 · php/php-src · GitHub
Open Graph Title: Unterminated JSON strings are misleadingly reported as “Control character error” · Issue #22527 · php/php-src
X Title: Unterminated JSON strings are misleadingly reported as “Control character error” · Issue #22527 · php/php-src
Description: Description The following code:
Open Graph Description: Description The following code:
X Description: Description The following code: <?php var_dump(json_decode('"'), json_last_error_msg()); Resulted in this output: NULL string(53) "Control character error, possibly incorrectly...
Opengraph URL: https://github.com/php/php-src/issues/22527
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unterminated JSON strings are misleadingly reported as “Control character error”","articleBody":"### Description\n\nThe following code:\n\n```php\n\u003c?php\n\nvar_dump(json_decode('\"'), json_last_error_msg());\n```\n\nResulted in this output:\n```\nNULL\nstring(53) \"Control character error, possibly incorrectly encoded\"\n```\n\nBut I expected this output instead: Something about EOF being reached.\n\n\n### PHP Version\n\n```plain\nPHP 8.5.7 (cli) (built: Jun 6 2026 05:36:56) (NTS)\nCopyright (c) The PHP Group\nBuilt by Ubuntu\nZend Engine v4.5.7, Copyright (c) Zend Technologies\n with Zend OPcache v8.5.7, Copyright (c), by Zend Technologies\n```\n\n### Operating System\n\n_No response_","author":{"url":"https://github.com/TimWolla","@type":"Person","name":"TimWolla"},"datePublished":"2026-06-30T10:17:26Z","url":"https://github.com/php/php-src/issues/22527"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1bceedf7-89a0-2d12-62ce-92ab613edcb0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BFB6:2E5652:2A1B2B:371387:6B00CEA8 |
| html-safe-nonce | da4c560ebbd9fc36884e06a358089d01fcf9223a4860345c517de4738420b5e2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkI2OjJFNTY1MjoyQTFCMkI6MzcxMzg3OjZCMDBDRUE4IiwidmlzaXRvcl9pZCI6IjMwNjgzOTA3OTc3MzM4NDI2MDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1597d53d9c499f815bd7e3e3bceab16bab8b22c2614a1ec4680b8d4508664861 |
| hovercard-subject-tag | issue:4775820387 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/php/php-src/22527/issue_layout |
| twitter:image | https://opengraph.githubassets.com/599035b13bfa5e8b6d8f7694b55b1ed17d6ae2f3fad82d884e04899995d5d29d/php/php-src/issues/22527 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/599035b13bfa5e8b6d8f7694b55b1ed17d6ae2f3fad82d884e04899995d5d29d/php/php-src/issues/22527 |
| og:image:alt | Description The following code: |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TimWolla |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85bbdfe2b6ba16e234513bc6ceff5d848ef8449820c900692a2b4e67061931e5 |
| turbo-cache-control | no-preview |
| go-import | github.com/php/php-src git https://github.com/php/php-src.git |
| octolytics-dimension-user_id | 25158 |
| octolytics-dimension-user_login | php |
| octolytics-dimension-repository_id | 1903522 |
| octolytics-dimension-repository_nwo | php/php-src |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1903522 |
| octolytics-dimension-repository_network_root_nwo | php/php-src |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4943239a6d2c591325dad6e5c313e1cafda877f6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width