开发者

PHP Omit Variables from Serialization

开发者 https://www.devze.com 2022-12-16 01:32 出处:网络
Is it possible to omit certain variables from serialization? Say I have a temporary variable in a php object that I don\'t want serialized as it is a waste of space. The only thing I can think of is m

Is it possible to omit certain variables from serialization? Say I have a temporary variable in a php object that I don't want serialized as it is a waste of space. The only thing I can think of is making them static but this is not ideal as it is not really part of t开发者_如何转开发he object which there will be many instances of.

This may not even be possible but would love to hear some ideas.


Take advantage of the __sleep method of your object.

0

精彩评论

暂无评论...
验证码 换一张
取 消