There is no equivalent of file_exists()
for the SplFileInfo
class.
SplFileInfo::isFile()
is a different check, which correlates with the is_file()
function (they share underlying code).
You could call the file_exists()
function on $imageLocation
, provided it references a stream wrapper that supports stat()
functionality. Wrappers such as file://
, phar://
and ftp://
(the latter only partially) support this.
Unfortunately the http://
(and https://
) wrapper does not support stat()
calls. This means file_exists()
, and other functions that call stat()
, will return false
.