php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #23044 Constant GLOB_ONLYDIR is absent in file php4ts.dll and unusable
Submitted: 2003-04-04 02:32 UTC Modified: 2003-04-07 15:54 UTC
From: ship at omskreg dot ru Assigned: alindeman (profile)
Status: Closed Package: Documentation problem
PHP Version: 4.3.1 OS: Windows 2000 (all Windows)
Private report: No CVE-ID: None
 [2003-04-04 02:32 UTC] ship at omskreg dot ru
in php4ts.dll (product version 4.3.1, file version 4.3.1.1):

Constant GLOB_ONLYDIR is absent (void) in file php4ts.dll.
Constant GLOB_ONLYDIR is unusable in function glob().
This constant (GLOB_ONLYDIR) is present in sources.

Error message in HTML code from PHP engine is:

Notice: Use of undefined constant GLOB_ONLYDIR - assumed 'GLOB_ONLYDIR' in C:\Program Files\Apache Group\Apache2\htdocs\dev\lib.php on line 58

Warning: glob() expects parameter 2 to be long, string given in C:\Program Files\Apache Group\Apache2\htdocs\dev\lib.php on line 58

Source PHP code for reproduce error:
$filesarray = glob("*", GLOB_ONLYDIR);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-04 11:28 UTC] sniper@php.net
It's just not avaialable under windows then.

 [2003-04-04 15:36 UTC] alindeman@php.net
Is that the only constant that isn't defined (I need to know before making a note of this in the docs)?  Assigning to myself...
 [2003-04-06 22:58 UTC] ship at omskreg dot ru
Other glob() constants (GLOB_MARK, GLOB_NOSORT, GLOB_NOCHECK, GLOB_NOESCAPE, GLOB_BRACE) are present in content of file php4ts.dll as text fragments. Only constant GLOB_ONLYDIR (this constant is described in documentation) is not present in content of file php4ts.dll, and therefore this constant cannot be used in PHP code.

Whether function glob() will work if to specify numerical value instead of constant GLOB_ONLYDIR as text, I do not know - am I did not try to make.
 [2003-04-07 15:54 UTC] alindeman@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2003-07-14 11:13 UTC] psychosos at gmx dot at
Using PHP 4.3.2 on Windows, GLOB_ONLYDIR still does not work but returns 

Warning: glob() expects parameter 2 to be long, string given in c:\program files\apache\htdocs\dir.php on line 9

Warning: Invalid argument supplied for foreach() in c:\program files\apache\htdocs\dir.php on line 9

As described above I can't find GLOB_ONLYDIR in php4ts.dll but I can find the other glob flags (like GLOB_NOESCAPE, GLOB_NOCHECK..)
The glob manual page doesn't note anything about GLOB_ONLYDIR not beeing useable as well.
Cheers..
 [2003-07-14 11:23 UTC] psychosos at gmx dot at
I am sorry, I just noticed bug #24482 (which seems quite similar to this one, if not even a dup) which also mentiones it has been fixed in CVS and got the new dir.c version, rebuild it and now it works well.
Sorry again, next time I'll be more careful. And thanks for PHP :)
Cheers..
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 12:00:02 2025 UTC