DEV Community

Discussion on: Reading Serialized PHP

Collapse
 
vlasales profile image
Vlastimil Pospichal

Look into serialized object. This name is a class name, not an object name. The object have no name.

Thread Thread
 
aaronarney profile image
Aaron

OK, after thinking about it a bit more critically I see what you're saying and I agree you are correct.

To those wanting to follow along...
Since serialize is used to essentially instruct PHP on how to recreate a value/variable, it needs to know what class to instantiate a new object with. That is what Vlastimil is pointing out, that serialization isn't storing the name of the object, but rather a reference to which class it inherits its methods/properties from.