php.net |  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
Votes:2
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: xuefer at 21cn dot com
New email:
PHP Version: OS:

 

 [2004-06-06 15:06 UTC] xuefer at 21cn dot com
Description:
------------
i don't know what this modify do, but it broke what the comment say.
relatived to #28289 ?
http://bugs.php.net/bug.php?id=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;
+#else
                        array_init(return_value);
                        return;
+#endif


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


Expected result:
----------------
an empty array()

Actual result:
--------------
bool(false)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-06 18:21 UTC] iliaa@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2004-09-01 10:27 UTC] derick@php.net
Reopening because of: http://bugs.php.net/bug.php?id=29928
 [2004-12-13 01:27 UTC] sniper@php.net
Fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 08:01:29 2024 UTC