Doc #60204 [NEW]: glob() function parameter string limited to 50 characters

From: Date: Wed, 02 Nov 2011 18:49:09 +0000
Subject: Doc #60204 [NEW]: glob() function parameter string limited to 50 characters
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7380@lists.php.net to get a copy of this message
From: Operating system: Windows XP SP2 PHP version: 5.3.8 Package: Documentation problem Bug Type: Documentation Problem Bug description:glob() function parameter string limited to 50 characters Description: ------------ --- From manual page: http://www.php.net/function.glob --- Documentation shortcoming for glob(). glob() does not seem to find any pattern that is longer than 50 characters. In particular, if one expands the search pattern to remove case sensitivity using sql_regcase() or an equivalent function as available the glob() manual page, (eg. which transforms "cake*" into "[cC][aA][kK][eE]*"), the number of characters is reduced four times to about 12 characters. This 50 character limitation should be documented in my opinion. Test script: --------------- //recursive glob() find function find($dir, $pattern){ //get a list of all matching files in the current directory $files = glob("$dir/".$pattern); //find a list of all directories in the current directory //directories beginning with a dot are also included foreach (glob("$dir/{.[^.]*,*}", GLOB_BRACE|GLOB_ONLYDIR) as $sub_dir){ $arr = find($sub_dir, $pattern); // resursive call $files = array_merge($files, $arr); // merge array with files from subdirectory } //return all found files return $files; } Expected result: ---------------- Nil. Alternatively, users can use preg_find (http://www.pgregg.com/projects/php/preg_find/preg_find.phps) which does not have a 50 character limitation. -- Edit bug report at https://bugs.php.net/bug.php?id=60204&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60204&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60204&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60204&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60204&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60204&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60204&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60204&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60204&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60204&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60204&r=support Expected behavior: https://bugs.php.net/fix.php?id=60204&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60204&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60204&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60204&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60204&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60204&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60204&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60204&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60204&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60204&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60204&r=mysqlcfg

« previous php.doc.bugs (#7380) next »