docker-alpine
docker-alpine copied to clipboard
PHP on Alpine gives Warning: Use of undefined constant GLOB_BRACE
Steps to reproduce:
docker run --rm -it php:7.4.32-zts-alpine3.16 php -r 'var_dump(GLOB_BRACE);' Expected result
int(1024)
Actual result
Warning: Use of undefined constant GLOB_BRACE - assumed 'GLOB_BRACE' (this will throw an Error in a future version of PHP) in Command line code on line 1 string(10) "GLOB_BRACE"
This is an Alpine-specific issue. docker run --rm -it php:7.4.32-zts-alpine3.16 php -r 'var_dump(GLOB_BRACE);' produces the expected result.
Hi,
As the note in PHP's documentation (https://www.php.net/glob) states:
Note: The GLOB_BRACE flag is not available on some non GNU systems, like Solaris or Alpine Linux.
So this seems to be the expected behavior.