The behavior of lstat is inconsistent with that in C
Open
@bukka is already working on this.
Since Jan 19, 2026.
Bug
Status: Needs Triage
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
When calling lstat on a dangling symbolic link file, it fails to retrieve the inode data of the linked file and directly returns false. I understand that this might be the original design, but the behavior should not differ from that in C. Furthermore, whether the linked target file can be accessed is originally the responsibility of stat, so why should lstat also be unable to read it?
PHP Version
PHP 8.4.12 (cli) (built: Aug 26 2025 13:36:28) (NTS)
Copyright (c) The PHP Group
Built by Homebrew
Zend Engine v4.4.12, Copyright (c) Zend Technologies
with Zend OPcache v8.4.12, Copyright (c), by Zend Technologies
Operating System
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.