note 124275 added to function.readdir

From: Date: Wed, 09 Oct 2019 05:44:22 +0000
Subject: note 124275 added to function.readdir
Groups: php.notes 
Request: Send a blank email to php-notes+get-212559@lists.php.net to get a copy of this message
Regarding the warning: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Of course, this means that if you use: <?php if($entry = readdir($handle) == false) … ?> or <?php while($entry = readdir($handle)) … ?> you may get a false false, as it were. As far as I can tell, the only time this would actually occur is if you encounter an entry of 0. According to https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting this appears to be the only string which will evaluate to false. ---- Server IP: 208.43.231.9 Probable Submitter: 82.199.157.54 (proxied: 60.241.83.80) ---- Manual Page -- http://php.net/manual/en/function.readdir.php Edit -- https://master.php.net/note/edit/124275 Del: integrated -- https://master.php.net/note/delete/124275/integrated Del: useless -- https://master.php.net/note/delete/124275/useless Del: bad code -- https://master.php.net/note/delete/124275/bad+code Del: spam -- https://master.php.net/note/delete/124275/spam Del: non-english -- https://master.php.net/note/delete/124275/non-english Del: in docs -- https://master.php.net/note/delete/124275/in+docs Del: other reasons-- https://master.php.net/note/delete/124275 Reject -- https://master.php.net/note/reject/124275 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#212559) next »