Skip to content

Fix glob('/dir/.*') to include . and .. dot entries (#17456) - #17459

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-17456-glob-dot-entries
Jul 8, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-17456-glob-dot-entries

Conversation

@PurHur

@PurHur PurHur commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix VmFsGlobPure to only skip . / .. (and other dotfiles) when the basename pattern does not explicitly request dotfiles (.*, .hidden, etc.)
  • Matches php-src ext/standard/dir.c — glob('/tmp/.*') now returns /tmp/. and /tmp/..
  • PHP-in-PHP fix in ext/standard/VmFsGlobPure.php; JIT/AOT share the same path via VmFsGlob / FsGlobJitHelper

Closes #17456

php-src reference

  • ext/standard/dir.c — PHP_FUNCTION(glob) dot-entry handling

Verification

php bin/vm.php test/repro/maintainer_gap_glob_dot_entries.php
# ok

php vendor/bin/phpunit test/unit/VmFsGlobTest.php --filter testVmFsGlobDotPatternIncludesDotEntries
# OK (1 test, 6 assertions)

php vendor/bin/phpunit test/compliance/ --filter glob_dot_entries
# OK (3 tests, 3 assertions) — VM + JIT

Made with Cursor

When the basename pattern explicitly requests dotfiles, stop unconditionally
skipping . and .. before fnmatch — matches php-src ext/standard/dir.c.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit c070dbc into master Jul 8, 2026
@PurHur
PurHur deleted the agent/issue-17456-glob-dot-entries branch July 8, 2026 19:19
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: glob('/dir/.*') omits . and .. — Zend matches dot entries (ext/standard/dir.c)

1 participant