Hi Stas, On Thu, 06 Oct 2011 17:26:49 +0200, Stas Malyshev wrote:
> Could you give a quick summary of what the decision point is just so I > won't miss anything scanning through the discussion and these bugs? In r299770 [1] I introduced a global var_hash to serialize() so that recursive calls to serialize()/unserialize() can know about the same objects/variable references. This was IMO a good thing to do (tm), but it obviously broke serializ behaviour when called in __sleep/__wakeup, because of the order of calls: serialize(obj) -> obj->__sleep does serialize() (in user code) -> then internally serialize(obj->prop) happens unserialize(obj) -> internally unserialize(obj->prop) is done -> obj->__wakeup is called which does unserialize() (user code) As one can see the IDs of the referenced objects when unserializing cannot match the IDs at serialization time, because of the mixed up call order. So I can only see two solutions: - either disallow serialize/unserialize in __sleep/__wakeup - or revert r299770 ... unless someone else has a better idea. [1] http://svn.php.net/viewvc/?view=revision&revision=299770 Mike -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php