Skip to content

glob:// wrapper doesn't cater to CWD for ZTS builds #17067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cmb69 opened this issue Dec 6, 2024 · 0 comments
Closed

glob:// wrapper doesn't cater to CWD for ZTS builds #17067

cmb69 opened this issue Dec 6, 2024 · 0 comments

Comments

@cmb69
Copy link
Member

cmb69 commented Dec 6, 2024

Description

The following code:

<?php
var_dump(count(scandir('glob://ext/*')));
chdir("ext");
var_dump(count(scandir('glob://*')));

Resulted in this output:

int(70)
int(0)

But I expected this output instead:

int(70)
int(70)

Plain glob() doesn't have this issue.

PHP Version

PHP 8.3

Operating System

any

@cmb69 cmb69 self-assigned this Dec 6, 2024
cmb69 added a commit to cmb69/php-src that referenced this issue Dec 6, 2024
`glob(3)` doesn't know the virtual CWD of PHP, so we need to pass an
absolute path for ZTS builds.  In lack of a reusable routine, we copy
the code from `glob()` and adapt as needed.
cmb69 added a commit that referenced this issue Dec 18, 2024
* PHP-8.3:
  Fix GH-17067: glob:// wrapper doesn't cater to CWD for ZTS builds
@cmb69 cmb69 closed this as completed in 53b69ba Dec 18, 2024
cmb69 added a commit that referenced this issue Dec 18, 2024
* PHP-8.4:
  Fix GH-17067: glob:// wrapper doesn't cater to CWD for ZTS builds
charmitro pushed a commit to wasix-org/php that referenced this issue Mar 13, 2025
`glob(3)` doesn't know the virtual CWD of PHP, so we need to pass an
absolute path for ZTS builds.  In lack of a reusable routine, we copy
the code from `glob()` and adapt as needed.

Closes phpGH-17074.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant