From:             
Operating system: 
PHP version:      5.3.6
Package:          Directory function related
Bug Type:         Bug
Bug description:readdir(false) returns NULL

Description:
------------
According to http://php.net/readdir readdir "Returns the filename on
success or FALSE on failure." As reported in #52383, since PHP 5.3 readdir
may also return NULL on failure.



The regression can be seen here:



# php -r 'var_dump(phpversion(), @readdir(false),
@readdir(false)===false);'

string(8) "5.2.11-2"

bool(false)

bool(true)



$ php -r 'var_dump(phpversion(), @readdir(false),
@readdir(false)===false);'

string(8) "5.3.6-10"

NULL

bool(false)



According to the first bullet on
http://php.net/manual/en/migration53.incompatible.php this would be an
intentional change, so this would be a documentation bug.





Test script:
---------------
var_dump(@readdir(false));

Expected result:
----------------
bool(false)

Actual result:
--------------
NULL

-- 
Edit bug report at http://bugs.php.net/bug.php?id=54673&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=54673&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=54673&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=54673&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=54673&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54673&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=54673&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=54673&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=54673&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=54673&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=54673&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=54673&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=54673&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=54673&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=54673&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54673&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54673&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=54673&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=54673&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=54673&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=54673&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=54673&r=mysqlcfg

Reply via email to