Re: Built-in classes that cannot be serialized

From: Date: Mon, 26 Nov 2018 12:40:26 +0000
Subject: Re: Built-in classes that cannot be serialized
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-103510@lists.php.net to get a copy of this message
Am 26.11.2018 um 13:35 schrieb Nikita Popov:
If I can rely on classes to throw an exception when serialize() is performed (be it through zend_class_serialize_deny or in __sleep()) then, yes, I can just try it.
I believe you can rely on this. Not on any specific exception type, but the fact that it will throw.
Good to know, thanks.
I've switched CURLFile, PDO and PDOStatement over to use serialize_deny. I couldn't find other classes in bundled extensions that were manually throwing on serialization.
Thanks!
that contains a class that cannot be serialized. Serializability is not a property of a single class or object, it's a property of the whole object graph that is being serialized.
I know: https://github.com/sebastianbergmann/global-state/blob/master/src/Snapshot.php#L360 ;-) Best, Sebastian

« previous php.internals (#103510) next »