|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-09-13 09:55 UTC] jani@php.net
[2007-09-13 10:16 UTC] kraghuba at in dot ibm dot com
[2008-08-18 08:06 UTC] pajoye@php.net
[2008-08-26 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 23:00:01 2025 UTC |
Description: ------------ Inconsistent behaviour of file_exists() & is_file() functions when given filename end with a trailing slash The functions: file_exists(), is_file() return inconsistent value on different OS when given filename/path end with a trailing slash (/). On RHEL 5 and Windows XP that i have, it retuns false, which is expected. There have been some fixes done relating to this to get the consistent behavior( match Windows with Linux behavior on handling on trailing slash, Defect #42027) but I have noticed that on different platform( linux and varient ) the output differ. I think, this is something to do with the way realpath work on different OS. Following are the testcases that continue to fail because of this on few linux and other Os but not on all(I have been watching the PHP-QA list and seen these failures): 1) is_file_variation4.phpt 2) rename_variation.phpt Reproduce code: --------------- <?php fclose( fopen("test.tmp") ); var_dump( is_file("test.tmp/") ); var_dump( file_exists("test.tmp/") ); unlink("test.tmp"); ?> Expected result: ---------------- bool(false) bool(false) Actual result: -------------- Actual output ( on some of Linux and other OS, excluding Windows ): ------------------------------------------------------------------- bool(true) bool(true)