note 124235 added to function.readdir

From: Date: Thu, 26 Sep 2019 01:05:50 +0000
Subject: note 124235 added to function.readdir
Groups: php.notes 
Request: Send a blank email to php-notes+get-212357@lists.php.net to get a copy of this message
PHP includes and alternative boolean operators whose precedence is below assignment. This means that an expression of the form <?php if(($a = something()) && $a !== false) … ; ?> can be written as <?php if($a = something() and $a !== false) … ; ?> In this case, the loop can be written as: <?php while ($entry = readdir($handle) and $entry !== false) { // etc } ?> ---- 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/124235 Del: integrated -- https://master.php.net/note/delete/124235/integrated Del: useless -- https://master.php.net/note/delete/124235/useless Del: bad code -- https://master.php.net/note/delete/124235/bad+code Del: spam -- https://master.php.net/note/delete/124235/spam Del: non-english -- https://master.php.net/note/delete/124235/non-english Del: in docs -- https://master.php.net/note/delete/124235/in+docs Del: other reasons-- https://master.php.net/note/delete/124235 Reject -- https://master.php.net/note/reject/124235 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#212357) next »