[ABE.pm] php and me
Ricardo SIGNES
perl.abe at rjbs.manxome.org
Mon Aug 11 11:20:30 PDT 2008
* Andy Armstrong <andy at hexten.net> [2008-08-11T13:09:57]
> As far as I know all you can do is assume that if the subscripts are
> all integers, start at zero and there are no gaps in the numbering
> that it's an array. In particular you'll be pleased to note that an
> empty array IS an empty hash - there is no way they can be
> distinguished because they're the same thing.
>
> PHP's own JSON encoder treats empty things as arrays rather than hashes:
>
> print json_encode(array());
> []
Ha. So, solution: arrays must have 0 or more sequential integer keys. Records
and maps must be stdClass objects.
--
rjbs
More information about the ABE-pm
mailing list