Commit b4d9a0a
Link to SplFileInfo from is_file()/file_exists() docs
And update the list of values that can be returned by getType based on
php 8.0 ext/standard/filestat.c
SplFileInfo is the only way to do some things, such as
1. Check for the existence of a file that may or may not be readable
without emitting a notice
that is caught by whatever error handler the project uses.
(e.g. file_exists can return false for unix sockets)
2. Check for file types such as unix sockets
(e.g. `$info->getType() === 'socket'`)
Recently, I was looking for how to check if a given path was a unix
socket and the filesystem functions didn't have any links to that
information.
Closes GH-319.1 parent 2bd21ff commit b4d9a0a
File tree
3 files changed
+4
-1
lines changed- reference
- filesystem/functions
- spl/splfileinfo
3 files changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
0 commit comments