Stdlib: json_validate() — validate JSON without decode (#3101) - #3121
Merged
Merged
Conversation
PurHur
force-pushed
the
agent/issue-3101-json-validate
branch
2 times, most recently
from
May 29, 2026 13:34
4c34197 to
3fda408
Compare
Add json_validate with host/json_decode VM fallback, C parser validate runtime, and compliance PHPTs. Reference: ext/json/json.c php_json_validate_ex. Co-authored-by: Cursor <cursoragent@cursor.com>
__compiler_json_validate MCJIT execution segfaults; VM compliance covers json_validate() (#3101). Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
force-pushed
the
agent/issue-3101-json-validate
branch
from
May 29, 2026 13:42
3fda408 to
53aa56f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements PHP 8.3
json_validate()for VM, JIT, and AOT:VmJsonValidateuses hostjson_validate()when available (PHP 8.3+), otherwisejson_decode()+json_last_error()withValueErroron depth exceed__compiler_json_validateinphpc_json_decode.creuses the existing JSON parser with configurablemax_depth; returns nativeint1for correct ternary truthinessext/standard/Module.php, JIT builtins, self-host policy, and capability matrixphp-src reference
ext/json/json.c—PHP_FUNCTION(json_validate)/php_json_validate_exVerification
Closes #3101
Made with Cursor