Re: An BC issue in unserialize

From: Date: Thu, 17 Jul 2014 05:34:12 +0000
Subject: Re: An BC issue in unserialize
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-75636@lists.php.net to get a copy of this message
Hi Laruence, On Thu, Jul 17, 2014 at 1:01 PM, Laruence <laruence@php.net> wrote: > /** > * Creates a new instance of the mapped class, without invoking > the constructor. > * > * @return object > */ > public function newInstance() > { > if ($this->_prototype === null) { > $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', > strlen($this->name), $this->name)); > } > > return clone $this->_prototype; > } > Just curious. This code is trying to initialize object with __wakeup() method rather than __construct(). Do you know what kind of object is initialized? What's the reason why it needs to use __wakeup() or avoid __construct()? If the usage is valid, we may try to find solutions. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net

« previous php.internals (#75636) next »