Hi,
We discussed adding a new serialize handler some time ago. That didn't seem
like a good idea and it concluded in my initial RFC for the new internal
serialize API. That API didn't have any patch and wouldn't fit to the
current API for serialization.
So I decided to completely redesign the proposed API. The resulted API is
in updated RFC: https://wiki.php.net/rfc/internal_serialize_api
I also created the patch that implements it:
https://github.com/php/php-src/pull/453
The API is only for extension and does not change anything in user space
(of course I run all tests to make sure that it's really the case). The
changes are internal (just for extensions :) ). That's way I created an
extension that tests the API. All results and examples are available at
https://github.com/bukka/php-extest/blob/master/doc/serialize.md
The tests are giving performance boost over 100% for the most useful
scenarios. The main candidate (where the new API could be used) is DateTime
and possibly other date objects. There are probably more extensions that
could use it (I need to have a look). I would be happy to prepare patches
if this proposal made it to the master branch. ;)
I am not the best RFC writer so I am not sure if the text explains
everything correctly. Please let if there is anything that is not
understandable.
I will be more than happy for any feedback.
Thanks
Jakub
<https://github.com/bukka/php-extest/blob/master/doc/serialize.md