note 7824 added to sizeof

From: Date: Wed, 16 Aug 2000 14:17:35 +0000
Subject: note 7824 added to sizeof
Groups: php.notes 
Request: Send a blank email to php-notes+get-1954@lists.php.net to get a copy of this message
To avoid such leaks (pressuming that you only want to pass through the array) and speeding up the code, you simply should use 'each'. 'for'-maniacs can use the following example too: for ($i=sizeof($arr);$i--;) { echo $arr[$i]; ...some sort of buggin code... } $i will be initialized only once! :-) http://www.php.net/manual/function.sizeof.php

« previous php.notes (#1954) next »