given this code:
$array = array('1' => 'one',
'2' => 'two',
'3' => 'three');
$arrayObject = new ArrayObject($array);
$iterator = $arrayObject->getIterator();
echo serialize($iterator);
I get this string a soutput:
C:13:"ArrayIterator":111:{x:i:16777216;C:11:"ArrayObject":65:{x:i:0;a:3:{i:1;s:3:"one";i:2;s:3:"two";i:3;s:5:"three";};m:a:0:{}};m:a:0:{}}
Now, presuming that this is what I understand from the output:
- C:13:"ArrayIterator" -> a Class which name length is 13 characters;
- i:16777216; -> an int (i) which value is 16777216;
- a:3:{i:1;s:3:"one";i:2;s:3:"two";i:3;s:5:"three";} -> an array of three elements, i:1 is the first num key, s:3:"one" is the value at that key, and so on...;
- a:0{} -> an empty array;
My questions:
- What are these bold/highlighted parts in the serialization:
C:13:"ArrayIterator":111:{x:i:16777216;C:11:"ArrayObject":65:{x:i:0;a:3:{i:1;s:3:"one";i:2;s:3:"two";i:3;s:5:"three";};m:a:0:{}};m:a:0:{}}
What are those "111" and "65" after "ArrayIterator" and "ArrayObject", respectively, what's their purpose?
What is the meaning of "x:i:16777216" and "x:i:0", I mean, I know i refers to an int, 16777216 and 0, respectively, but what about that x? What is it for?
What are those empty arrays prefixed with m (m:a:0:{}) inside ArrayObject and ArrayIterator? What's the purpose of the m?
Is there a complete reference or something which covers the topic a little bit deeper than the PHP manual, because I haven't found infos or examples on the PHP man page about such object serialization.
Thank you for the attention!