|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-09-12 05:34 UTC] bhsmither at gmail dot com
Description: ------------ glob() function http://us3.php.net/manual/en/function.glob.php Documentation says: "GLOB_NOCHECK - Return the search pattern if no files matching it were found." Tests indicate that the search pattern is not returned 'verbatim', but rather an array (with wildcard characters in place) with each array element representing one possible combination of braced options, the whole array having all possible combinations. Test script: --------------- <?php $language='L:\WebServer\htdocs\language\es-ES'; $qqq=glob(' with '.$language.'{-custom,-normal}.xml', GLOB_BRACE | GLOB_NOCHECK); print_r($qqq); ?> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 02:00:01 2025 UTC |
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. I can not reproduce your problem. <?php $language='L:\WebServer\htdocs\language\es-ES'; $qqq=glob(' with '.$language.'{-custom,-normal}.xml', GLOB_BRACE | GLOB_NOCHECK); print_r($qqq); ?> This returns: Array ( [0] => with L:\WebServer\htdocs\language\es-ES{-custom,-normal}.xml ) For me, which is the expected output according to the documentation. Can you please provide the output you get and include which version of PHP you're using and on what Operating System Software. Thanks.This is my result on two different installations: Array ( [0] => with L:\WebServer\htdocs\language\es-ES-custom.xml [1] => with L:\WebServer\htdocs\language\es-ES-normal.xml ) PHP 5.4.4 on Windows XP SP3 Build Date Jun 13 2012 21:17:57 Compiler MSVC9 (Visual C++ 2008) Architecture x86 Server API CGI/FastCGI PHP API 20100412 PHP Extension 20100525 Zend Extension 220100525 Zend Extension Build API220100525,TS,VC9 PHP Extension Build API20100525,TS,VC9 Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans PHP 5.3.5 on Windows Server 2003 R2 SP2 Build Date Jan 6 2011 17:50:45 Compiler MSVC6 (Visual C++ 6.0) Architecture x86 Server API Apache 2.0 Handler PHP API 20090626 PHP Extension 20090626 Zend Extension 220090626 Zend Extension Build API220090626,TS,VC6 PHP Extension Build API20090626,TS,VC6 Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with the ionCube PHP Loader v4.0.7, Copyright (c) 2002-2011, by ionCube Ltd., and with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans