Skip to content

Bootstrap: VM scandir() via VmDir opendir/readdir (#5048) - #5778

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-5048-scandir-native-vm
Jun 4, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-5048-scandir-native-vm

Conversation

@PurHur

@PurHur PurHur commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #5048

php-src reference

ext/standard/dir.c — php_scandir / php_scandir_ex

Verification

docker info >/dev/null
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
./vendor/bin/phpunit test/compliance/VMTest.php --filter glob_scandir -v
./vendor/bin/phpunit test/unit/VmFsGlobTest.php -v'

Output:

OK (1 test, 1 assertion)   # VMTest glob_scandir
OK (5 tests, 14 assertions)  # VmFsGlobTest

Note on #5771

Lane C issue #5771 (enum (array) cast) already passes on master (#5536); closing separately.

Made with Cursor

Replace host \scandir() in ext/standard/scandir.php with VmDir::scandir()
built on the existing opendir/readdir/closedir helpers. Supports
SCANDIR_SORT_ASCENDING/DESCENDING/NONE for M5 bootstrap without calling
Zend scandir from the VM builtin path.

Verification: ./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./vendor/bin/phpunit test/compliance/VMTest.php --filter glob_scandir && ./vendor/bin/phpunit test/unit/VmFsGlobTest.php'
Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit ab1d783 into master Jun 4, 2026
@PurHur
PurHur deleted the agent/issue-5048-scandir-native-vm branch June 4, 2026 15:44
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.

Bootstrap: scandir() VM — native directory listing without host PHP

1 participant