Hi Benoît, Benoît Burnichon wrote:
Looking at the manual http://php.net/manual/en/language.types.array.php#language.types.array.casting , it seems `ArrayObject` class does not comply to array casting because integer public properties could also be retrieved. Some tests showed that regular class always have string keys even when a `$key = 0; $this->{$key} = 'avalue';` is called. In this case, `var_export((array)$object);` returns `array('0' => 'avalue')` (Notice the quote around key 0 - https://3v4l.org/6QW70)
I'm not sure what specifically you see to be the problem, but I think it might be worth directing you to my RFC which relates to this:
https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts -- Andrea Faulds https://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php