Stdlib: web_int/web_string/web_bool param coercion (issue #157)#387
Merged
Conversation
Ship query/body coercion helpers for compiled web apps: web_int and web_string are reachable from compile.php with JIT/AOT lowering; web_bool is VM-only until bool-return JIT assignment is fixed. Co-authored-by: Cursor <cursoragent@cursor.com>
22f8ed2 to
fab0798
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
web_int(),web_string(), andweb_bool()builtins for safe query/body coercion (closes Web: Query/body param coercion helpers (int, bool, string) #157).web_intandweb_stringregister inext/standard/Module.phpwith VM handlers and JIT lowering (JitWebParams) so they work frombin/compile.php/ AOT binaries with$_GETrefresh.web_boolis VM-only for now (documented indocs/capabilities.md); AOT callers can useweb_int($src, $key, 0)until bool-return JIT assignment is fixed.Behavior
web_intsupports optional min/max clamping.web_stringtrims and optionalmaxLentruncation.Test plan
test/real/cases/web_param_coerce.phpttest/compliance/cases/stdlib/web_param_coerce_jit.phpttest/fixtures/aot/cases/web_param_coerce.phptweb_int/web_stringAOT withQUERY_STRINGscript/docker-ci-local.sh(88/91 AOT tests; 3 pre-existinggetenv/putenvfixture failures unrelated to this change)Made with Cursor