note 99772 added to function.file-exists
| From: | _michael at osu1 dot php dot net | Date: | Sun, 05 Sep 2010 21:16:42 +0000 |
| Subject: | note 99772 added to function.file-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-172322@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 69.147.83.197
Probable Submitter: 91.57.98.17
----
Manual Page -- http://www.php.net/manual/en/function.file-exists.php
Edit -- https://master.php.net/note/edit/99772
Del: integrated -- https://master.php.net/note/delete/99772/integrated
Del: useless -- https://master.php.net/note/delete/99772/useless
Del: bad code -- https://master.php.net/note/delete/99772/bad+code
Del: spam -- https://master.php.net/note/delete/99772/spam
Del: non-english -- https://master.php.net/note/delete/99772/non-english
Del: in docs -- https://master.php.net/note/delete/99772/in+docs
Del: other reasons-- https://master.php.net/note/delete/99772
Reject -- https://master.php.net/note/reject/99772
Search -- https://master.php.net/manage/user-notes.php