Re: array key's: which is correct?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2010-06-08 at 16:12 +0300, Tanel Tammik wrote:

> Hi,
> 
> which one is correct or "better"?
> 
> $array[3] = '';
> or
> $array['3'] = '';
> 
> $i = 7;
> 
> $array[$i] = '';
> or
> $array["$i"] = '';
> 
> 
> Br
> Tanel 
> 
> 
> 


The two indexes are equivalent, although I reckon the integer one will
give better performance over the string.

Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux