php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24482 GLOB_ONLYDIR is not working
Submitted: 2003-07-03 07:30 UTC Modified: 2003-07-04 09:43 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: acoon at acoon dot dk Assigned: hholzgra (profile)
Status: Closed Package: *Directory/Filesystem functions
PHP Version: 4.3.2 OS: FreeBSD 4.5
Private report: No CVE-ID: None
 [2003-07-03 07:30 UTC] acoon at acoon dot dk
Description:
------------
When using GLOB_ONLYDIR on FreeBSD 4.5 is returns an error.


PHP was configured like this.
'./configure' '--with-mysql' '--with-apxs=/usr/local/sbin/apxs' '--with-curl' '--with-gd' '--with-jpeg-dir=/usr/local/include/' '--with-zlib-dir' '--enable-ftp' '--with-ttf' '--enable-bcmath'


Changes made to php.ini:
register_globals = On

Reproduce code:
---------------
<?php
foreach (glob("*", GLOB_ONLYDIR) as $dir) {
    print "$dir is a dir!<BR>";
}
?>


Expected result:
----------------
I would expect to get all dirs printet.

Actual result:
--------------
Warning: glob() expects parameter 2 to be long, string given in index.php on line 43

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-03 07:56 UTC] hholzgra@php.net
the comment in the manual is missleading,
GLOB_ONLYDIR is a GNU extension so it is only available on systems with GNU libc

i'm looking into adding an emulation wrapper to the C code

if it doesn't work i'll update the documentation
 [2003-07-03 09:41 UTC] hholzgra@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

should be fixed in PHP 5 CVS now,
i will merge the changes into the 4.3 tree as soon as i know that it doesn't break anything
 [2003-07-03 16:21 UTC] acoon at acoon dot dk
I've just tried php4-STABLE-200307031330
I still get the same error.

And i get another error when doing 'make install' in php4-STABLE-200307031330.

----
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20020429/
Installing PEAR environment:      /usr/local/lib/php/
[PEAR] Archive_Tar: Could not open the package file: package-Archive_Tar.xml
[PEAR] Console_Getopt: Could not open the package file: package-Console_Getopt.xml
[PEAR] PEAR: Could not open the package file: package-PEAR.xml
[PEAR] DB: Could not open the package file: DB-1.5.0RC1.tar
[PEAR] HTTP: Could not open the package file: HTTP-1.2.tar
[PEAR] Mail: Could not open the package file: Mail-1.1.0.tar
[PEAR] Net_SMTP: Could not open the package file: Net_SMTP-1.2.3.tar
[PEAR] Net_Socket: Could not open the package file: Net_Socket-1.0.1.tar
[PEAR] XML_Parser: Could not open the package file: XML_Parser-1.0.1.tar
[PEAR] XML_RPC: Could not open the package file: XML_RPC-1.0.4.tar
Installing build environment:     /usr/local/lib/php/build/
Installing header files:          /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
----
 [2003-07-04 01:47 UTC] sniper@php.net
The fix is in PHP _5_ not in PHP 4 (yet), so try the latest PHP _5_ snapshot..

 [2003-07-04 09:43 UTC] hholzgra@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.

now fixed in both the PHP 5 and the PHP 4.3 tree (including a regresssion test)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 10:01:29 2024 UTC