|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23722 with dir() is_file() return always false ...
Submitted: 2003-05-20 13:30 UTC Modified: 2003-05-20 16:49 UTC
From: ca533512 at tiscali dot cz Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 4.3.2RC3 OS: win2k SP3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ca533512 at tiscali dot cz
New email:
PHP Version: OS:


 [2003-05-20 13:30 UTC] ca533512 at tiscali dot cz
I want to read a dir with dir() function and dir to open is like "images/php" then is_file() function doesn't working correctly ... (return false or NULL)


$d = dir("images/php");
while ($file = $d -> read()) {
   if (is_file($file)) { // <- this line always return false

when i use chdir() function to change directory, all working correctly ...

Must I use chdir() func. ???
is this a regular feature ???



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-20 16:49 UTC]
Yes, it is an expected feature. You have to do if(is_file('images/php/'.$file)). dir() will not chdir so when you call is_file it tries to see if $file is present in your current directory.

Not a bug -> Bogus.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Mar 22 13:05:49 2023 UTC