Problem
parse_url() works in the VM (ext/standard/parse_url.php, compliance PHPT) and is used internally by lib/Web/DevServer.php and Superglobals::derivePathInfo(). JIT throws LogicException; AOT is unsupported (docs/capabilities.md: VM only).
Front-controller routing (#210, #276) in compiled binaries needs URL parsing without calling host PHP:
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
Goal
JIT and AOT fast paths for the existing VM subset:
- One- and two-argument forms
- Components:
PHP_URL_PATH, PHP_URL_QUERY, PHP_URL_HOST, PHP_URL_PORT, PHP_URL_SCHEME
- Full array return for
http:// / https:// URLs and path-only strings like /app?q=1
Implementation hints
- Reuse logic from
ext/standard/VmString.php (parseUrlPath, host/port split) — avoid duplicating RFC 3986; match VM outputs exactly.
ext/standard/parse_url.php — implement compileJIT() / wire through Internal base like strlen.
- Add JIT compliance case if not already covered; AOT PHPT under
test/fixtures/aot/cases/parse_url.phpt.
- Register in
docs/capabilities.md with --check gate in script/ci-local.sh.
Acceptance criteria
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
./script/ci-local.sh --filter parse_url
JIT compliance and AOT PHPT pass; capability matrix shows JIT/AOT yes.
Verification (local / Docker only)
make test-docker
# or:
./script/docker-ci-local.sh
Dependencies
Links
Problem
parse_url()works in the VM (ext/standard/parse_url.php, compliance PHPT) and is used internally bylib/Web/DevServer.phpandSuperglobals::derivePathInfo(). JIT throwsLogicException; AOT is unsupported (docs/capabilities.md: VM only).Front-controller routing (#210, #276) in compiled binaries needs URL parsing without calling host PHP:
Goal
JIT and AOT fast paths for the existing VM subset:
PHP_URL_PATH,PHP_URL_QUERY,PHP_URL_HOST,PHP_URL_PORT,PHP_URL_SCHEMEhttp:///https://URLs and path-only strings like/app?q=1Implementation hints
ext/standard/VmString.php(parseUrlPath, host/port split) — avoid duplicating RFC 3986; match VM outputs exactly.ext/standard/parse_url.php— implementcompileJIT()/ wire throughInternalbase likestrlen.test/fixtures/aot/cases/parse_url.phpt.docs/capabilities.mdwith--checkgate inscript/ci-local.sh.Acceptance criteria
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ ./script/ci-local.sh --filter parse_urlJIT compliance and AOT PHPT pass; capability matrix shows JIT/AOT yes.
Verification (local / Docker only)
make test-docker # or: ./script/docker-ci-local.shDependencies
preg_matchfor regex routing (orthogonal; parse_url is simpler paths)Links
ext/standard/parse_url.php,ext/standard/VmString.phptest/compliance/cases/stdlib/parse_url.phpt