php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28890 readdir() doesn't work when compiled with gcc 2.95.3
Submitted: 2004-06-23 10:06 UTC Modified: 2004-06-25 10:15 UTC
From: webmaster at rrze dot uni-erlangen dot de Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 5.0.0RC3 OS: SunOS 5.9
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: webmaster at rrze dot uni-erlangen dot de
New email:
PHP Version: OS:

 

 [2004-06-23 10:06 UTC] webmaster at rrze dot uni-erlangen dot de
Description:
------------
uname -a:
SunOS {HOSTNAME} 5.9 Generic_112233-12 sun4u sparc SUNW Ultra-Enterprise

PHP5.0.0RC3, compiled as cgi-sapi (with cli) with gcc version 2.95.3 for 64bit.

Calling the readdir() function returns a "Fatal error: Call to undefined function readdir()", both from the cgi- and cli-sapi.
This is not influenced by execute rights of the php binary.
Using -e (extended debugging info) and -n (don't use php.ini) doesn't provide any further information.
This in turn makes the PEAR Installation fail as those scripts also use readdir().
opendir(), is_dir(), dir(), scandir(), getcwd(), chdir() all work.




Reproduce code:
---------------
CGI:
----
if ($handle = opendir("/any/path/here")) {
   while (false !== ($file = readdir($handle))) { 
       echo "$file\n";
   }
}

CLI:
----
php -e -n -r 'if ($handle = opendir("/any/path/here")) { while (false !== ($file = readdir($handle))) { echo "$file\n"; } };'


Expected result:
----------------
list of files in the directory

Actual result:
--------------
Fatal error: Call to undefined function readdir()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-23 13:59 UTC] webmaster at rrze dot uni-erlangen dot de
Seperate build with gcc 3.4.0 eliminates the described readdir() problem.
Apologies for declaring the problem as a php bug when it actually is a gcc issue.

# gcc --version
gcc (GCC) 3.4.0
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 [2004-06-25 10:15 UTC] derick@php.net
User error -> bogus then
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Aug 09 08:01:25 2020 UTC