|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-26 10:39 UTC] jani@php.net
[2007-11-26 10:55 UTC] ppalka7 at abacus dot pl
[2007-11-26 11:06 UTC] jani@php.net
[2007-11-26 20:09 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 20 06:00:01 2025 UTC |
Description: ------------ Glob return incorect types values if directory not exists Reproduce code: --------------- $arr=glob('directory/not/exists/*.jpg'); echo 'Is array-'.is_array($arr).'<br />'; echo 'Sizeof-'.sizeof($arr).'<br />'; echo '<pre>'; print_r($arr); echo '</pre>'; foreach($arr as $key => $val) { echo $val; } Expected result: ---------------- php 5.2.4 Is array-1 Sizeof-0 Array ( ) Actual result: -------------- php 5.2.5 Is array- Sizeof-1 Warning: Invalid argument supplied for foreach() in /home/projekt5/public_html/phpbug/glob.php on line 14