Skip to content

Regression: glob(null)/fnmatch(null) still coerce under PROFILE=8.4 (re-#20139, ext/standard/file.c, fnmatch.c) #20554

Closed

Description

@PurHur

Category

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

Problem

#20139 was closed as fixed, but under PHP_COMPILER_PROFILE=8.4 both builtins still soft-coerce null instead of throwing TypeError like php-src 8.1+/8.4.

Verified 2026-07-18 (VM PROFILE=8.4, Docker php-compiler:22.04-dev):

Repro Zend 8.4+ VM (2026-07-18)
glob(null) TypeError []
fnmatch(null, 'a') TypeError false

Default/8.2 reference profile may still deprecate/coerce like Zend 8.2 — 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 "
foreach ([\"glob\" => fn() => glob(null), \"fnmatch\" => fn() => fnmatch(null, \"a\")] as \$n => \$f) {
  try { \$r = \$f(); echo \$n, \" COERCED \", var_export(\$r, true), PHP_EOL; }
  catch (Throwable \$e) { echo \$n, \" \", get_class(\$e), PHP_EOL; }
}
"'

Done when

  • Under PHP_COMPILER_PROFILE=8.4, glob(null) and fnmatch(null, …) throw TypeError
  • Default/8.2 reference profile still matches Zend 8.2 (deprecate/coerce — do not break)
  • Compliance .phpt / repro guard under test/compliance/ or test/repro/
  • php-src-strict; no php-compiler-strict shortcut

Related

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 18, 2026
  2. PurHur commented on Jul 20, 2026

    @PurHur
    OwnerAuthor

    claim: worker-lane-b — starting this run

  3. PurHur commented on Jul 20, 2026

    @PurHur
    OwnerAuthor

    Merged via #21253

    Verification (PROFILE=8.4):
    ```
    glob TypeError
    fnmatch TypeError
    ```
    VM + JIT repro test/repro/issue_20554_glob_fnmatch_null84.php; compliance glob_fnmatch_null_forward84*.phpt (4/4 PHPUnit).

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