php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5540 Simple test on a string fails
Submitted: 2000-07-12 19:23 UTC Modified: 2000-09-07 15:03 UTC
From: alain at onesite dot org Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.1pl2 OS: Linux RedHat 5.2 2.0.36
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alain at onesite dot org
New email:
PHP Version: OS:

 

 [2000-07-12 19:23 UTC] alain at onesite dot org
This works (copied from the manual) :

<?php
    $handle=opendir('.');
    echo "Directory handle: $handle\n";
    echo "Files:\n";
    while ($file = readdir($handle)) {
        echo "$file\n";
    }
    closedir($handle); 
?>

This doesn't work :

<?php
    $handle=opendir('.');
    echo "Directory handle: $handle\n";
    echo "Files:\n";
    while ($file = readdir($handle)) {
/* just added this test : */
if ($file!=".")
{
        echo "$file\n";
}
    }
    closedir($handle); 
?>

Live example :

http://www.onesite.org/testphp/ok.php3
http://www.onesite.org/testphp/ko.php3
http://www.onesite.org/testphp/ok.php3.txt
http://www.onesite.org/testphp/ko.php3.txt

Live phpinfo: http://www.onesite.org/phpinfo.php3
php.ini : http://www.onesite.org/php.ini

PHP installed from the tarball, running as a
cgi through a shellscript.
Fails from the command line too
The same scripts work fine with php 3.0.12

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-27 22:23 UTC] zak@php.net
I am not sure what to make of this.

When I first tested this bug about 4 days ago, I had the same results.  I just tested it again and I cannot reproduce it... even using his ini file.

Could someone see if they can reproduce this?
 [2000-08-17 12:58 UTC] zak@php.net
Received feedback from x-empt@ispep.cx:
"Cannot reproduce with his ini or mine on 4.0.1pl2 - Linux, although RH 5.2 was not tested."

I still cannot re-reproduce this problem...
 [2000-09-06 18:09 UTC] zak@php.net
Could you try upgrading to 4.0.2?
 [2000-09-07 15:03 UTC] zak@php.net
Finally!  This problem should be fixed in the most recent CVS version (00/09/07) :)

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Jul 03 02:00:01 2026 UTC