php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #13890 Docu-Error at opendir()
Submitted: 2001-10-31 15:14 UTC Modified: 2001-11-07 14:26 UTC
From: hannes dot dorn at ibit dot at Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.6 OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hannes dot dorn at ibit dot at
New email:
PHP Version: OS:

 

 [2001-10-31 15:14 UTC] hannes dot dorn at ibit dot at
Related File: chm
"This file was generated: Thu Jul 26 22:28:30 2001"

In opendir() docu, it says:

if ($dir = @opendir("/tmp")) {
  while($file = readdir($dir)) {
    echo "$file\n";
  }  
  closedir($dir);
}

The while statement stops wenn a filename contains only of a "0". In readdir() the docu is correct.

$handle=opendir('.');
echo "Directory handle: $handle\n";
echo "Files:\n";
while (($file = readdir($handle))!==false) {
    echo "$file\n";
}
closedir($handle); 
Note the !== false in the while statement.

Rasty

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-07 14:25 UTC] philip@php.net
Fixed.

 [2001-11-07 14:26 UTC] philip@php.net
fixed and now closed :)

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 14:01:33 2025 UTC