Problem
Validation before superglobal access often uses:
if (is_string($_GET['id'] ?? '')) { /* ... */ }
docs/capabilities.md lists is_array, is_string, is_null, is_int as yes in VM, but JIT may not lower them to fast type-byte checks — hot paths in routers regress to generic calls.
Goal
Ensure is_* type guards are fast in JIT (return i1, branch-friendly) and remain correct in VM/AOT for web validation patterns.
Implementation hints
Audit first
grep -R "function is_string" ext/ lib/
script/capability-matrix.php --check
Confirm whether gap is JIT-only or VM stub.
VM
- Reuse
Variable::type / existing ext/types/ implementations.
is_string must accept internal string representation used by superglobal values.
JIT (lib/JIT.php + ext/types/)
- Lower to
TYPE_* byte compare → i1 (same pattern as other type builtins in matrix).
- Do not box superglobals unnecessarily before
is_*.
Tests
| Case |
Purpose |
is_string($_GET['x'] ?? '') |
Web guard with #99 when landed |
is_array($rows) |
Router table check |
| JIT PHPT group |
--group llvm compliance if exists |
Acceptance criteria
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
php bin/jit.php -r 'var_dump(is_string("a"));'
Prints bool(true) without falling back to VM interpreter for the check itself (verify via JIT compliance or dedicated unit test).
Verification (local / Docker only)
./script/ci-local.sh --filter 'is_string|is_array'
Requires LLVM (#98); use make test-docker on harness hosts.
Dependencies
Links
Problem
Validation before superglobal access often uses:
docs/capabilities.mdlistsis_array,is_string,is_null,is_intas yes in VM, but JIT may not lower them to fast type-byte checks — hot paths in routers regress to generic calls.Goal
Ensure
is_*type guards are fast in JIT (return i1, branch-friendly) and remain correct in VM/AOT for web validation patterns.Implementation hints
Audit first
grep -R "function is_string" ext/ lib/ script/capability-matrix.php --checkConfirm whether gap is JIT-only or VM stub.
VM
Variable::type/ existingext/types/implementations.is_stringmust accept internal string representation used by superglobal values.JIT (
lib/JIT.php+ext/types/)TYPE_*byte compare →i1(same pattern as other type builtins in matrix).is_*.Tests
is_string($_GET['x'] ?? '')is_array($rows)--group llvmcompliance if existsAcceptance criteria
Prints
bool(true)without falling back to VM interpreter for the check itself (verify via JIT compliance or dedicated unit test).Verification (local / Docker only)
./script/ci-local.sh --filter 'is_string|is_array'Requires LLVM (#98); use
make test-dockeron harness hosts.Dependencies
??for idiomatic superglobal guardsis_*)Links
docs/capabilities.md(types module rows)