ID: 26737 Comment by: mastabog at hotmail dot com Reported By: rob dot wills at gmail dot com Status: Critical Bug Type: Zend Engine 2 problem Operating System: * PHP Version: 5.0.0 New Comment:
I really *really* don't understand why this bug (it is a bug .. everyone sees it that way) doesn't get fixed. It's quite important ... Padding the variables with nulls and classname or * is not my suggestion or hack, it's what I've seen it does looking in the session file. Currently ther eis no other way to selectively save variables between sessions. Right now i'm using the Reflection API to autodetect property types and then construct the array for __sleep(). Hope I won't be force to develop too many of those ... For {albin at kth dot se}: the point of specifying which variables to save is quite easy to explain .. sometimes you only want to save a few out of a bunch of properties. Its easier to state those which you want to save than those which you don't. Of course, sometimes its the othr way around and you wish you had something to specify those you don't want. Here's where the Reflection API can help (see the Zend2 Engine changes, bottom: http://sitten-polizei.de/php/reflection_api/docs/language.reflection.html) Previous Comments: ------------------------------------------------------------------------ [2004-07-28 15:21:01] albin at kth dot se What is even the point of __sleep being supposed to return an array of the properties that should be serialized? I think it would be much easier just to manually unset those variables that you DON'T want to serialize, and letting PHP serialize everything else. I thought __sleep was supposed just to be a way of closing database-connections etc, but due to the current implementation that seems almost impossible. ------------------------------------------------------------------------ [2004-07-18 13:44:42] [EMAIL PROTECTED] version info change ------------------------------------------------------------------------ [2004-07-15 12:44:57] [EMAIL PROTECTED] Verified. The workaround still works too. ------------------------------------------------------------------------ [2004-07-15 04:14:39] rob dot wills at gmail dot com PHP5.0.0 still exhibits this behaviour. Is there anything else I can provide to help with this issue/bug? Thanks, Rob ------------------------------------------------------------------------ [2004-07-13 00:10:35] trevorrowe at gmail dot com Last posting was made on feb 26, its now jul 12. ------------------------------------------------ Anyone have any more current news on this bug? The bug seems to still persist in php5 rc3. mastabog's suggestion of padding the variable name with nulls for private, padding the * for protected and nothing for public works, but seems like an ugly hack. My biggest fear is when the bug is patched, my variable names will be double padded and things will start to break. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/26737 -- Edit this bug report at http://bugs.php.net/?id=26737&edit=1