Bug #75136 [Opn->Fbk]: readdir is returning null.

From: Date: Wed, 30 Aug 2017 12:57:50 +0000
Subject: Bug #75136 [Opn->Fbk]: readdir is returning null.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210879@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75136&edit=1 ID: 75136 Updated by: salathe@php.net Reported by: dmitriy dot vinograd at gmail dot com Summary: readdir is returning null. -Status: Open +Status: Feedback Type: Bug Package: Directory function related Operating System: Ubuntu 16.04.3 LTS PHP Version: 7.0.22 Block user comment: N Private report: N New Comment: What makes you think false is a valid argument for the function? Previous Comments: ------------------------------------------------------------------------ [2017-08-30 12:51:10] dmitriy dot vinograd at gmail dot com Description: ------------ --- From manual page: http://www.php.net/function.readdir --- readdir(false) is returning a null, despite the fact documentation says it must be a string or false Which may put the example from the documentation in an infinitive loop, and in case if a server is saving warning messages into a log it will fill the server disk that in turn will put the server offline. Test script: --------------- var_dump(readdir(false)); //Will return // Warning: readdir() expects parameter 1 to be resource, boolean given in /..../test.php on line 11 // /..../test.php:11:null while (false !== ($logFile = readdir(false))) { var_dump($logFile); } // Will put your process an infinitive loop ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75136&edit=1

« previous php.bugs (#210879) next »