docker-alpine icon indicating copy to clipboard operation
docker-alpine copied to clipboard

PHP on Alpine gives Warning: Use of undefined constant GLOB_BRACE

Open nabad600 opened this issue 1 year ago • 1 comments

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.

nabad600 avatar Oct 10 '22 15:10 nabad600

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.

fpoirotte avatar Apr 15 '23 13:04 fpoirotte