Bug #69628 [Opn->Ver]: glob() returns empty array on Windows 7, BUT not CentOS 6.7

From: Date: Wed, 13 May 2015 12:29:48 +0000
Subject: Bug #69628 [Opn->Ver]: glob() returns empty array on Windows 7, BUT not CentOS 6.7
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192650@lists.php.net to get a copy of this message
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:             Open
+Status:             Verified
 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:

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);


Previous Comments:
------------------------------------------------------------------------
[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)

« previous php.bugs (#192650) next »