php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #45547 GLOB_MARK definition incorrect
Submitted: 2008-07-17 17:59 UTC Modified: 2008-07-21 12:57 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: heikki dot removethis dot andthis at kaeraja dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: All
Private report: No CVE-ID: None
 [2008-07-17 17:59 UTC] heikki dot removethis dot andthis at kaeraja dot com
Description:
------------
The documentation for the glob() function says:

GLOB_MARK - Adds a slash to each item returned

This seems to be incorrect, since the GLOB_MARK flag actually adds a DIRECTORY_SEPARATOR to the returned items that are directories. Of course, what is currently described in the documentation would not make much sense anyway...

Tested with PHP 4.4.8 under vmlinuz 2.6.9-42.0.3.EL.xs0.4.0.263xenU
Tested with PHP 5.2.5 under Windows Vista

Reproduce code:
---------------
glob("./*",GLOB_MARK)

Expected result:
----------------
array("./file.ext/","./directory.ext/")

Actual result:
--------------
array("./file.ext","./directory.ext/")

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-21 12:57 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 23:00:01 2026 UTC