Skip to content

Stdlib: curl_escape/unescape(null) TypeError on PROFILE=8.4 (#20695) - #20731

Merged
PurHur merged 1 commit into
masterfrom
agent/ext-io-20695-curl-escape-null-typeerror
Jul 18, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/ext-io-20695-curl-escape-null-typeerror

Conversation

@PurHur

@PurHur PurHur commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route curl_escape / curl_unescape $string through VmString::coerceZparamStrBuiltinArg + JitStringBuiltinArg::lowerZparamStr so null TypeErrors under PHP_COMPILER_PROFILE=8.4 (php-src-strict; matches urlencode).
  • AOT early-return on constant null avoids linking __string__rawurlencode after TypeError+abort.
  • Compliance + AOT fixtures; 8.2 profile still coerces to ''.

Closes #20695

php-src reference

PHP implementation

  • ext/curl/curl_escape.php, ext/curl/curl_unescape.php

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
PHP_COMPILER_PROFILE=8.4 php bin/vm.php -r "…"   # TypeError ×2
PHP_COMPILER_PROFILE=8.4 php bin/jit.php -r "…"  # TypeError ×2
PHP_COMPILER_PROFILE=8.2 php bin/vm.php -r "…"   # '' ''
PHP_COMPILER_HELPER_RUNTIME_O=1 PHP_COMPILER_PROFILE=8.4 php bin/compile.php -o /tmp/x /tmp/curl_escape_null84.php && /tmp/x
# compile_exit=0 run_exit=255 TypeError
vendor/bin/phpunit --filter "curl_escape_null|CurlEscapeBuiltin"
# OK (8 tests)
vendor/bin/phpunit test/aot/AotTest.php --filter curl_escape_null_forward84
# OK (1 test)
'

Pillar 1 (pre-claim)

Gate Result
inventory OK 5799/5799
release-readiness --json user_release_ready: yes
north-star5-fast ok
vm-driver-probe ok

Test plan

  • VM PROFILE=8.4 TypeError
  • JIT PROFILE=8.4 TypeError
  • AOT PROFILE=8.4 exit 255 TypeError
  • PROFILE=8.2 still coerces
  • compliance + AotTest filters green

Made with Cursor

Use Z_PARAM_STR coerce/lower paths so null rejects under forward 8.4 like
urlencode, with AOT early-return to avoid linking rawurlencode after abort.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 7bd9375 into master Jul 18, 2026
@PurHur
PurHur deleted the agent/ext-io-20695-curl-escape-null-typeerror branch July 18, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: curl_escape()/curl_unescape(null) still coerce under PROFILE=8.4 (ext/curl/interface.c)

1 participant