note 50781 deleted from function.readdir by nlopess
| From: | nlopess@php.net | Date: | Fri, 11 Mar 2005 19:42:12 +0000 |
| Subject: | note 50781 deleted from function.readdir by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-86276@lists.php.net to get a copy of this message | ||
Note Submitter:
----
Caution using this classic:
while($file = readdir($d)) { ... }
This loop will terminate in the unfortunate event that readdir encounters a file named "0"
(that's a number zero). I spent half an hour debugging this!
This is not a bug of course, since PHP evaluates "0" to FALSE. So beware.
Paul.