Jason Davidson <mailto:[EMAIL PROTECTED]>
on Wednesday, March 10, 2004 12:25 AM said:
> would the following example be faster or slower had i simply done
> $this->myArray[$i] = $i;
>
> class MyClass {
> var $myArray = array();
>
> function MyClass() {
> $myTempArray = array();
> for($i=0;$i<100;$i++)
> $myTempArray[$i] = $i;
> $this->myArray = $myTempArray;
> }
> }
here's how i would do it (coding styles aside):
function MyClass()
{
$limit = 100;
$i = -1;
while(++$i < $limit)
{
$this->myArray[] = $i;
}
}
chris.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php