Skip to content

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

Description

@PurHur

Category

Regression · php-src-strict · PHP 8.4 null→TypeError · pillar 4

Problem

Under PHP_COMPILER_PROFILE=8.4, curl_escape($handle, null) and curl_unescape($handle, null) still coerce null → ''. Sibling URL encoder urlencode(null) already TypeErrors on the same profile. Signature/handle parity from #20493 is in place; forward null reject on $string is not.

Repro Zend 8.4+ (forward) VM PROFILE=8.4 (2026-07-18)
curl_escape(curl_init(), null) TypeError ''
curl_unescape(curl_init(), null) TypeError ''
control: urlencode(null) TypeError TypeError (OK)

Host Zend 8.2 still coerces with deprecation — this ticket is forward 8.4 profile only.

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && PHP_COMPILER_PROFILE=8.4 php bin/vm.php -r "
\$h = curl_init();
try { var_export(curl_escape(\$h, null)); echo \" COERCED\\n\"; }
catch (Throwable \$e) { echo get_class(\$e), \": \", \$e->getMessage(), \"\\n\"; }
try { var_export(curl_unescape(\$h, null)); echo \" COERCED\\n\"; }
catch (Throwable \$e) { echo get_class(\$e), \": \", \$e->getMessage(), \"\\n\"; }
"'

Done when

  • curl_escape/curl_unescape throw TypeError on null $string under PHP_COMPILER_PROFILE=8.4 (VM + JIT + AOT)
  • Compliance .phpt guard under test/compliance/cases/curl/ (or test/repro/)
  • php-src-strict; no php-compiler-strict shortcut
  • Default/8.2 profile may still coerce (match Zend 8.2)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions