$array['12'] will automagicly become $array[12]
however
$array['012'] 
will always be a string index

-Jason


----- Original Message ----- 
From: "Daniel Lorch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 3:23 PM
Subject: [PHP-DEV] Array vs Hashes


> Hi,
> 
> I don't know whether this was already discussed before, but ..
> 
> have you ever though about the fact that PHP is not very cleanly
> designed when looking at Arrays and Hashes? How can I predict whether
> a array/hash is sorted by it's INTEGER indices or it's STRING indices
> when using functions such as asort(), ksort() .. I don't know whether
> these indices are casted into the other type or not. Maybe, by
> accident I write $array['12'] = .. and from then PHP thinks I'm using
> string indices (thus casting all indices to string).
> 
> Of couse, I could just try out but that isn't really a proper and
> clean language design. Shouldn't it be possible to FORCE either
> method? such as
> 
>  i_asort();
>  str_asort();
> 
> ok, that's a quite stupid proposal but you get the idea I hope :)
>  
> Kind Regards,
>   Daniel Lorch
> 
> 
> 
> -- 
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to