Re: serialize() casts numeric string keys to integers
| From: | Adam Richardson | Date: | Mon, 12 Nov 2012 15:46:10 +0000 |
| Subject: | Re: serialize() casts numeric string keys to integers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-319692@lists.php.net to get a copy of this message | ||
On Mon, Nov 12, 2012 at 2:18 AM, eyal.t <eyal.t@zend.com> wrote:
> Hi all,
>
> Was wondering whether the fact that serialize() casts numeric string keys
> to integers, is a bug, intended behaviour, or just something that is minor
> enough not to have bothered anyone yet?
>
This behavior is consistent with the standard key casts for arrays:
http://php.net/manual/en/language.types.array.php
Try dumping the array before the serialize operations.
Adam
--
Nephtali: A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com