Re: Unserialize is broken

From: Date: Sun, 28 Feb 2010 19:35:15 +0000
Subject: Re: Unserialize is broken
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-47063@lists.php.net to get a copy of this message
On 28 February 2010 19:03, Herman Radtke <hermanradtke@gmail.com> wrote: >> Imo unserialize should check, when applying public or protected values, >> if either exists on the object, and apply it to the one that exists. >> Sure it's gonna cost some performance, but at least changing the >> prototype of your class while stuff is running isn't going to kill your >> code anymore. > > This seems like a corner case and one that a conversion script should > handle.  Considering that serialize and unserialize are called for > every single web-request, degrading the performance of unserialize is > not something that should be done lightly. > > > > -- > Herman Radtke > hermanradtke@gmail.com | http://hermanradtke.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > As serializing reports protected and private properties, would it not be right that unserialize should work within the private scope of an object and then follow the same rules as userland code. It would guess that unserialize really doesn't need to know the visibility or at least shouldn't be creating properties based upon those visibilities but rather applying the values to the existing properties. -- ----- Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling

« previous php.internals (#47063) next »