|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-12-03 05:56 UTC] cameel2+php at gmail dot com
Description: ------------ On my system the glob() returns false if there are no files matching the pattern even though the documentation (http://php.net/manual/en/function.glob.php) states that it should return an empty array. PHP version: 5.3.3 The only things I have changed in php.ini are open_basedir (/srv/http/:/home/:/usr/share/webapps:/etc/webapps:/tmp/:/usr/share/pear/:/usr/share/symfony) and enabling of several extensions (mcrypt, mysql, pdo, pdo_sqlite). I've seen similar bugs reported and closed a few years ago: #29928 Test script: --------------- <?php // phpMyAdmin is an empty, existing directory located in Apache root $glob = glob('/phpMyAdmin/*'); echo $glob == false ? "false\n" : ""; echo is_array($glob) ? "array\n" : ""; ?> Expected result: ---------------- glob() should return an empty array if no files match the pattern. Actual result: -------------- The script prints 'false' when run on my box (both under Apache 2.2.17 and with php from command line). PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 16:00:01 2025 UTC |
Are you sure you mean $glob = glob('/phpMyAdmin/*'); and not $glob = glob('phpMyAdmin/*');? The sooner is an absolute path '/phpMyAdmin/', where the 2nd path is relative (to CWD).