igbinary_unserialize
(PECL igbinary >= 1.1.1)
igbinary_unserialize —
Creates a PHP value from a stored representation from igbinary_serialize()
Опис
igbinary_unserialize() takes a single serialized variable from
igbinary_serialize() and converts it back into a PHP value.
Увага
Untrusted user input must not be passed to igbinary_unserialize().
Unserialization can result in code being loaded and executed due to object
instantiation and autoloading, and a malicious user may be able to exploit
this. Instead a safe, standard data interchange format such as JSON (via
json_decode() and json_encode()) should be used,
if serialized data needs to be passed to a client.
If there is the need to unserialize externally-stored serialized data,
hash_hmac() can be used for data validation.
It is important to ensure that nobody has tampered with the data.
Увага
The igbinary serialization format does not provide a way to distinguish between different reference
groups for the same value. All PHP references to a given value as treated as part
of the same reference group when unserialized,
even if they were parts of difference reference groups when serialized.
Помилки/виключення
Objects may throw Throwables in their unserialization handlers.
Примітки
Увага
null or false is returned both in the case of an error and if unserializing
the serialized null or false value. It is possible to catch this special case by
comparing str with
igbinary_serialize(null) or igbinary_serialize(false)
or by catching the issued E_NOTICE.