[Pmwiki-users] Some issues with the latest pmwiki release

Patrick R. Michaud pmichaud at sci.tamucc.edu
Tue Apr 29 10:45:06 CDT 2003


On Tue, 29 Apr 2003, Jonathan Scott Duff wrote:

> http://www.php.net/manual/en/language.types.array.php
> 
> That reads to me like PHP has one type of array and it tries to be
> smart enough to do what you mean when you specify integer or string
> indices.  

Yes.  PHP tries to be smart and sometimes it shoots itself in the foot
in doing so.  And yes, PHP only has one type of array.  And unlike Perl,
PHP associative arrays preserve the order of entries in the array--a 
feature I took advantage of in PmWiki 0.4.

> So if you just use "numeric strings" like so:
> 
> $array["1.2"] =  ... ;
> $array["1.25"] =  ... ;
> $array["1.2356"] =  ... ;
> 
> All is well.  (of course you'll have to ksort() the array before you
> use it, but you should be doing that anyway)

However, I'm not sure I want to try to explain to a naive administrator 
why "11.1" comes before "2.5", or why $array["1.2"]  is different
from $array[1.2].  This is especially since PHP will accept both 
without warning but produce different and difficult-to-describe/explain 
results depending on which is used.

Pm





More information about the pmwiki-users mailing list