|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72095 Undefined constant GLOB_BRACE while doc-base/configure.php
Submitted: 2016-04-24 13:44 UTC Modified: 2016-04-25 14:04 UTC
Avg. Score:3.8 ± 1.0
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:3 (60.0%)
From: Assigned:
Status: Open Package: Doc Build problem
PHP Version: Irrelevant OS: Alpine Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2016-04-24 13:44 UTC]
When running doc-base/configure.php (as pointed in for any language (en or translations), in Alpine Linux, 3 error messages are thrown, 1 notice and 2 warnings:

$ php doc-base/configure.php --enable-xml-details
Iterating over extension specific version files... PHP Notice:  Use of undefined constant GLOB_BRACE - assumed 'GLOB_BRACE' in /php-manual/doc-base/configure.php on line 573
PHP Warning:  glob() expects parameter 2 to be long, string given in /php-manual/doc-base/configure.php on line 573
PHP Warning:  Invalid argument supplied for foreach() in /php-manual/doc-base/configure.php on line 573

The message "All good. Saving .manual.xml… done." is shown in the end, anyway we could make these errors disappear.

Researching a little I found that this happens in Alpine Linux because seems that it doesn't support GLOB_BRACE since it is using musl libc instead of GNU libc.


The workaround is not hard to implement (

Instead of using directly

... GLOB_BRACE ...

it's just to check if it's defined before otherwise defaults to 0, like this:

... defined('GLOB_BRACE') ? GLOB_BRACE : 0 ...

As shown above, it's the way the issue was solved in Zend Framework.


As Alpine Linux is going to get more attention mainly because of Docker based environments because it's very lightweight (, I guess this workaround proposed is worth to have here as well.


phpdoc-glob_brace_alpine-linux.patch (last revision 2016-04-24 13:45 UTC by rogeriopradoj at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-24 16:07 UTC]
I don't like the inline ternary use, just define the constant upfront in stead and then it looks good to me.
 [2016-04-25 14:04 UTC]
Setting GLOB_BRACE to 0 obviously deactivates the advanced
features of glob()[1]. Either GLOB_BRACE is necessary, or not. In
the latter case we simply can remove the flag; in the former we'd
break the code.

[1] <>
 [2017-02-12 00:17 UTC]
There is some code above that is expecting the GLOB_BRACE to work.

 $globdir = dirname($ac["GENERATE"]) . "/{../,./}versions.xml";

This could be worked around.....or people could just use operating systems that glob_brace is present on.
 [2018-01-22 07:52 UTC] nanhe dot kumar at gmail dot com
Notice: Use of undefined constant GLOB_BRACE - assumed 'GLOB_BRACE' in /var/www/html/opencart/upload/admin/controller/extension/extension.php on line 2
Warning: glob(): At least one of the passed flags is invalid or not supported on this platform in /var/www/html/opencart/upload/admin/controller/extension/extension.php on line 41Warning: Invalid argument supplied for foreach() in /var/www/html/opencart/upload/admin/controller/extension/extension.php on line 44

When i list  defined constant GLOB_BRACE is missing.
GLOB_ONLYDIR => 1073741824

Linux opencart-77fcc87595-2gqvw 4.4.86+ #1 SMP Thu Dec 7 20:11:11 PST 2017 x86_64
Current PHP version: 7.1.12
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 14:01:29 2024 UTC