You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All file functions, incl. dir functions like file_exists() or is_dir() return false when the input is empty.
One exception is realpath(), it returns the current directory when '' is given.
The reason is probably the way how realpath() is written, the path is probably checked if absolute and if not, it is appended to the current directory, even if empty.
After a fix, I expect realpath('') to return false.
It is probably not a bug, as documented so [1], but I propose this to be fixed to be consistent with other file functions.
A small note. The above functions are boolean unlike realpath.
I just looked at how the standard function works and it returns an error on empty input. Maybe it's better to make it close to the implementation in C.
Description
All file functions, incl. dir functions like
file_exists()
oris_dir()
returnfalse
when the input is empty.One exception is
realpath()
, it returns the current directory when''
is given.The reason is probably the way how
realpath()
is written, the path is probably checked if absolute and if not, it is appended to the current directory, even if empty.After a fix, I expect
realpath('')
to returnfalse
.It is probably not a bug, as documented so [1], but I propose this to be fixed to be consistent with other file functions.
[1] php/doc-en@5ca36de
The text was updated successfully, but these errors were encountered: