I've attached a patch (both for HEAD and the PHP_5_3 branch) that allows the magic __sleep() method to return NULL
to continue the normal serialization process (all members are serialized). This allows the __sleep() method to do meaningful cleanup without having to resort to Reflection overhead. The patch retains the original behavior (E_NOTICE) if anything other than an array or NULL
is returned from the function.
I check the results of a "make test" on the PHP_5_3 branch with and without the patch. I skipped the results from HEAD because there were so many unrelated failures it was pointless. The one additional failure in 5.3 with the patch is actually a reverse unit test. I've included a patch (separately, because it's the same for HEAD and PHP_5_3) to correct the expected result from this test.
Thanks,
Andrew
Hello Andrew,
the patches look fine. Can you include the test change in both HEAD and
5.3 version of an updated patch (it got outdated meanwhile).
marcus
Tuesday, November 6, 2007, 9:51:19 PM, you wrote:
I've attached a patch (both for HEAD and the PHP_5_3 branch) that allows the magic __sleep()
method to returnNULL
to continue the normal serialization process (all members are
serialized). This allows the __sleep() method to do meaningful cleanup without having to
resort to Reflection overhead. The patch retains the original behavior (E_NOTICE) if anything
other than an array orNULL
is returned from the function.
I check the results of a "make test" on the PHP_5_3 branch with and without the patch. I
skipped the results from HEAD because there were so many unrelated failures it was pointless.
The one additional failure in 5.3 with the patch is actually a reverse unit test. I've
included a patch (separately, because it's the same for HEAD and PHP_5_3) to correct the
expected result from this test.
Thanks,
Andrew
Best regards,
Marcus