Re: An BC issue in unserialize
| From: | Stas Malyshev | Date: | Thu, 17 Jul 2014 07:58:23 +0000 |
| Subject: | Re: An BC issue in unserialize | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75659@lists.php.net to get a copy of this message | ||
Hi!
> As discussed in previous threads about this failure, we (doctrine) can
> move away from the
unserialize() hack if
> ReflectionClass#newInstanceWithoutConstructor() provides
> support for
> internal classes.
Could you explain why it is needed to instantiate internal classes
without calling the ctor? I'd like to understand the use case more.
> It doesn't need to cover ALL internal classes, just the most commonly
> extended ones.
The problem is we do not know which of these classes may fail if
instantiated without initializing. With PHP classes, it's easy since the
engine takes care of the basic plumbing. With C classes, if you don't
call the function, you get nulls or worse, garbage, in places where
values are expected.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/