note 99772 deleted from function.file-exists by cmb
| From: | cmb@php.net | Date: | Sun, 29 Sep 2019 07:17:05 +0000 |
| Subject: | note 99772 deleted from function.file-exists by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212388@lists.php.net to get a copy of this message | ||
Note Submitter: _ michael
----
There is a subtle difference in behaviour of file_exists(), depending on the OS. Suppose you test a
path ending with a slash. If the corresponding filesystem object exists, but is not a directory but
a file, file_exists() will return true on Windows and false on Linux.
Ie, file_exists( $path_from_root . '/somedir/file/' ) returns true on Windows if that file
exists, and false on Linux.
Tested with PHP 5.3.3 on Ubuntu and PHP 5.2.9 on Windows.