> > So rather change the engine, which affects way more things and add yet > another serialisation hook making it even more confusing what to use? > > >
Yes I agree that the new hook is confusing. I think that what Gustavo said would be actually much better. Having some flag that would say what is the purpose of retrieving properties could be very useful. It's not just serialization but also casting object to array. There can be even more use cases in the future. On top of it the hooks like get_gc and get_debug_info could be part of it. But I would rather discuss this leter when I send a patch. > > You're solution also depends on an API break and also changes the way > the objects behave during serialization/unserialization. > > Not sure what you mean by API break and changing the way the objects behave? When you look to this pach https://github.com/bukka/php-src/compare/date_serialize there shouldn't be any difference in object behaviour. Or am I wrong? By BC I meant the resulted string that you get after using serialize function. If you use Serializable you get something that is prefixed by C: . But if you have object, the prefix is O: . Please see this http://3v4l.org/Sd8aT . Jakub