php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4996 readdir responding differently Netscape/IE
Submitted: 2000-06-13 01:32 UTC Modified: 2000-08-18 18:41 UTC
From: derek at grouptel dot net Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Release Candidate 2 OS: Linux
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: derek at grouptel dot net
New email:
PHP Version: OS:

 

 [2000-06-13 01:32 UTC] derek at grouptel dot net
The goal is to read a list of files in a directory into an array and sort them. The following code snip returns different results between Netscape and IE.

### snip ############################
$handle=opendir($root.$dir);
while ($file = readdir($handle)) {
  $retVal[count($retVal)] = $file;
}
closedir($handle);
sort($retVal);
### snip ############################

Neither browser gets an error, but in IE the array contains all of the files and directories, in Netscape only the directories are in the array (no files).

Env:
Linux 2.2.15
Apache 1.3.12
PHP 4.0.0 (MySQL, TrackVars)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-28 07:07 UTC] stas at cvs dot php dot net
PHP is not dependant on the browser, it's server-side program.
Please provide more info on what you are doing (parameters, etc.)
 [2000-06-28 09:48 UTC] derek at grouptel dot net
I've received email about this and I AM aware that PHP is server-side, that is why I filed the bug, this should not happen. Maybe it has something to do with the way Apache handles the connection? KeepAlives? The page renders quickly in both browsers so I don't think it's a time issue.
 [2000-08-01 04:37 UTC] andi@php.net
It is kind of weird that your clients behave differently.
In any case, can you please try and use the latest CVS version or latest snapshot (snaps.php.net)and see if you're still have the same problem. There was a bug fixed which had to do with readdir but I doubt this is the problem it fixed.
 [2000-08-18 18:41 UTC] sniper@php.net
No feedback from user.

--Jani
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Jun 29 04:00:02 2026 UTC