Bug #62047 [Opn->Nab]: IIS 6.0 & PHP 5.4.3 / IIS 6.0 & PHP PHP 5.3.8 / Apache 2.2.21 & PHP 5.3.8

From: Date: Thu, 17 May 2012 02:03:59 +0000
Subject: Bug #62047 [Opn->Nab]: IIS 6.0 & PHP 5.4.3 / IIS 6.0 & PHP PHP 5.3.8 / Apache 2.2.21 & PHP 5.3.8
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-170528@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62047&edit=1

 ID:                 62047
 Updated by:         laruence@php.net
 Reported by:        turboe at gmx dot de
 Summary:            IIS 6.0 & PHP 5.4.3 / IIS 6.0 & PHP PHP 5.3.8 /
                     Apache 2.2.21  & PHP 5.3.8
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Win7/WinXP
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

This function(readdir) may return Boolean FALSE, but may also return a non-
Boolean value which evaluates to FALSE. Please read the section on Booleans for 
more information. Use the === operator, see: 
http://www.php.net/manual/en/function.readdir.php

which means you should write your code  like :

while (($file2 = readDir($verzeichnis2)) !== FALSE) 
{
	echo $file2;
	echo "<br>";
}


Previous Comments:
------------------------------------------------------------------------
[2012-05-16 14:46:30] turboe at gmx dot de

Description:
------------
Problem with openDir/readDir:
A folder with the name "0" breaks openDir/readDir.

Sometimes you will have different orders,
but the script breaks on the folder with the name "0".

Tested on PHP 5.4 and 5.3 on different Webservers. (IIS + Apache) and different OS (Win7 + WinXP)

Test script:
---------------
<?php

$verzeichnis2 = openDir("//fileserver/Daten/");
while ($file2 = readDir($verzeichnis2)) 
{
	echo $file2;
	echo "<br>";
}

?>

Expected result:
----------------
folders:
.
..
0
1
2







Actual result:
--------------
Output from the example-script:
.
..


If you rename the Dir "0" to "X0" the output looks like:
.
..
X0
1
2


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62047&edit=1


Thread (2 messages)

« previous php.bugs (#170528) next »