Bug #69628 [Ver->Ana]: glob() returns empty array on Windows 7, BUT not CentOS 6.7
Edit report at https://bugs.php.net/bug.php?id=69628&edit=1
ID: 69628
Updated by: cmb@php.net
Reported by: russ at herballure dot com
Summary: glob() returns empty array on Windows 7, BUT not
CentOS 6.7
-Status: Verified
+Status: Analyzed
Type: Bug
Package: Filesystem function related
Operating System: Windows 7 SP1 64-bit
PHP Version: 5.6.8
Block user comment: N
Private report: N
New Comment:
See php-src/1278.
Previous Comments:
------------------------------------------------------------------------
[2015-05-13 12:29:47] cmb@php.net
As it is now, all but the last pair of brackets within a braced
alternative is simply ignored on Windows. So
glob('D:\\Icons\\*.{[jJ][pP][gG],[gG][iI][fF]}', GLOB_BRACE);
is actually treated like
glob('D:\\Icons\\*.{[gG],[fF]}', GLOB_BRACE);
------------------------------------------------------------------------
[2015-05-13 06:51:17] russ at herballure dot com
Description:
------------
When using glob() on Win 7 64 PHP 5.6.8,
when using GLOB_BRACE with multiple brackets within the braces,
glob() returns an empty array even when files match.
This same function works as expected on PHP 5.3.10 on CentOS 6.7.
Test script:
---------------
$x = glob('D:\\Icons\\*.{[jJ][pP][gG],[gG][iI][fF]}', GLOB_BRACE);
var_dump($x);
/*
The target directory "D:\Icons\" contains these files:
image1.jpg
image2.GIF
image3.bmp
*/
Expected result:
----------------
array(2) {
[0]=> "D:\Icons\image1.jpg"
[1]=> "D:\Icons\image2.GIF
}
Actual result:
--------------
array(0) {
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69628&edit=1
Thread (4 messages)