|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28649 glob() nomatch return false
Submitted: 2004-06-06 15:06 UTC Modified: 2004-12-13 01:27 UTC
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: xuefer at 21cn dot com Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.3.7 OS: linux
Private report: No CVE-ID: None
 [2004-06-06 15:06 UTC] xuefer at 21cn dot com
i don't know what this modify do, but it broke what the comment say.
relatived to #28289 ?

@@ -388,10 +390,14 @@
                        /* Linux handles no matches as an error condition, but FreeBSD
                         * doesn't. This ensure that if no match is found, an empty array
                         * is always returned so it can be used without worrying in e.g.
                         * foreach() */
+#if __linux__
+                       RETURN_FALSE;

Reproduce code:
php -r 'var_dump(glob("abcdefg"));'

Expected result:
an empty array()

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-06 18:21 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2004-09-01 10:27 UTC]
Reopening because of:
 [2004-12-13 01:27 UTC]
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 21:01:29 2024 UTC