Skip to content
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

Documentation says is_file() returns true for regular files but it also returns true for symlinks pointing to regular files #3719

Open
ohyeaah opened this issue Sep 6, 2024 · 1 comment

Comments

@ohyeaah
Copy link

ohyeaah commented Sep 6, 2024

From manual page: https://php.net/function.is-file

It says "Tells whether the filename is a regular file".
But it also returns true for symlinks pointing to regular files. And symlinks are not regular files.

It should instead say "Tells whether the given file is a regular file or a symlink pointing to a regular file".

@cmb69
Copy link
Member

cmb69 commented Sep 6, 2024

It's basically like stat():

If filename is a symbolic link, statistics are from the file itself, not the symlink.

In other words, unless explicitly mentioned, symlinks are resolved transparently.

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

No branches or pull requests

2 participants