note 113440 added to function.count

From: Date: Thu, 10 Oct 2013 17:54:14 +0000
Subject: note 113440 added to function.count
Groups: php.notes 
Request: Send a blank email to php-notes+get-196522@lists.php.net to get a copy of this message
I think that maybe that is faster (I don't know why, because, at least in C, for loops are faster than while ones due to compile optimization) but what is sure is that, in case the list is empty, you are going to iterate over the loop at least one. And I'm sure that is not what you want to do. The correct way in this occassion is to use a normal while, not a do, while. ---- Server IP: 69.147.83.199 Probable Submitter: 188.84.209.63 ---- Manual Page -- http://php.net/manual/en/function.count.php Edit -- https://master.php.net/note/edit/113440 Del: integrated -- https://master.php.net/note/delete/113440/integrated Del: useless -- https://master.php.net/note/delete/113440/useless Del: bad code -- https://master.php.net/note/delete/113440/bad+code Del: spam -- https://master.php.net/note/delete/113440/spam Del: non-english -- https://master.php.net/note/delete/113440/non-english Del: in docs -- https://master.php.net/note/delete/113440/in+docs Del: other reasons-- https://master.php.net/note/delete/113440 Reject -- https://master.php.net/note/reject/113440 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#196522) next »