Skip to content

Stdlib: scandir()/opendir() php://filter — not implemented wrapper diagnostics (#18418)#18420

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-18418-scandir-filter-wrapper-error
Jul 12, 2026
Merged

Stdlib: scandir()/opendir() php://filter — not implemented wrapper diagnostics (#18418)#18420
PurHur merged 1 commit into
masterfrom
agent/issue-18418-scandir-filter-wrapper-error

Conversation

@PurHur

@PurHur PurHur commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route scandir()/opendir() directory-open failures on php:// URIs through VmFsPhpWrapper::openDirFailureReason() so VM emits Zend's not implemented text instead of generic No such file or directory.
  • scandir() on php wrappers now also emits the follow-up scandir(): (errno 0): Success warning per php-src ext/standard/dir.c.
  • JIT/AOT warnings moved from inline LLVM in JitFsGlob to FsGlobJitHelper/OpendirJitHelper PHP helpers (php-in-PHP SSOT).

php-src reference

  • ext/standard/dir.cphp_scandir, php_opendir
  • main/streams/userspace.c — wrapper dir_opener not-implemented path

PHP implementation

  • ext/standard/VmFsPhpWrapper.phpopenDirFailureReason()
  • ext/standard/VmFilestatFailure.php — VM warnings
  • ext/standard/OpendirJitHelper.php, ext/standard/FsGlobJitHelper.php — JIT/AOT warnings

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/maintainer_gap_scandir_filter_wrapper_error.php
vendor/bin/phpunit --filter scandir_filter_wrapper_error
'

Output:

scandir=false
opendir=false
warnings=scandir(php://filter/read=string.rot13/resource=data://text/plain,test): Failed to open directory: not implemented|scandir(): (errno 0): Success|opendir(php://filter/read=string.rot13/resource=data://text/plain,test): Failed to open directory: not implemented
OK (2 tests, 2 assertions)

Closes #18418

Made with Cursor

…ics (#18418)

Route directory open failures on php:// URIs through VmFsPhpWrapper::openDirFailureReason()
so VM/JIT/AOT emit Zend's "not implemented" text and scandir's errno-0 follow-up warning.

Co-authored-by: Cursor <cursoragent@cursor.com>
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: scandir()/opendir() on php://filter — ENOENT not "not implemented" (ext/standard/dir.c)

1 participant