I read this from the PHP manual:
If an object is converted to an array, the result is an array whose elements are the object's properties. The keys are the member variable names, with a few notable exceptions: integer properties are unaccessible; private variables have the class name prepended to the variable name; protected variables have a '*' prepended to the variable name. These prepended values have null bytes on either side. This can result in some unexpected behaviour:
class A { private $A; // This will become '\0A\0A' } class B extends A { private $A; // This will become '\0B\0A' public $AA; // This will become 'AA' } var_dump((array) new B());
The above will appear to have two keys named 'AA', although one of them is actually named '\0A\0A'.
I don't quite understand the meaning of those parts with typeface like this.
What's a integer property?
What's the meaning of "These prepended values have null bytes on either side. This can result in some unexpected behaviour"?
and What's the meaning of "?The above will appear to have two keys named 'AA', although one of them is actually named '\0A\0A'"