|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22384 FNM_CASEFOLD is not available
Submitted: 2003-02-23 01:36 UTC Modified: 2003-02-28 02:36 UTC
From: polone at townnews dot com Assigned: hholzgra
Status: Closed Package: Directory function related
PHP Version: 4.3.1 OS: RedHat Linux 7.3
Private report: No CVE-ID:
 [2003-02-23 01:36 UTC] polone at townnews dot com
The predefined constant FNM_CASEFOLD does not exist for the fnmatch() function. The function call does work by calling the function using:

fnmatch('pattern*','match-this', 16);

At least, on RedHat Linux this will work because the flag is a left bit shift 1 << 4. Probably just not defined in the PHP extension as a flag (although I haven't checked).

The flag allows case-insensitive comparisons to the string being matched. Using the integer constant directly shouldn't break anything if the constant is later added, just an annoyance as far as looking at source is concerned.


Patrick O'Lone


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-23 02:30 UTC]
From my fnmatch.h (rh 6.2):

#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
# define FNM_FILE_NAME   FNM_PATHNAME   /* Preferred GNU name.  */
# define FNM_LEADING_DIR (1 << 3)       /* Ignore `/...' after a match.  */
# define FNM_CASEFOLD    (1 << 4)       /* Compare without regard to case.  */

Maybe we should add '#define _GNU_SOURCE' before including the fnmatch.h in ext/standard/file.c ??
Assigned for Hartmut who's responsible for adding this function.. :)

 [2003-02-28 02:36 UTC]
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
In case this was a documentation problem, the fix will show up soon at

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

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Sun Oct 04 17:01:29 2015 UTC