Re: GMP serialization
| From: | Jakub Zelenka | Date: | Wed, 30 Oct 2013 22:34:12 +0000 |
| Subject: | Re: GMP serialization | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69972@lists.php.net to get a copy of this message | ||
On Wed, Oct 30, 2013 at 9:46 PM, Nikita Popov <nikita.ppv@gmail.com> wrote:
>
> As already pointed out on the php-cvs mailing list, this is not a
> backwards compatibility break because it only changes implementation
> details of a feature introduced in master (PHP 5.6). GMP numbers were never
> serializable in any released version of PHP. Ability to serialize was added
> as part of https://wiki.php.net/rfc/operator_overloading_gmp.
>
> Nikita
>
>
Ok cool no prob
Just tried some weird cases and think that there is an another problem. The
self referencing of object don't work. The serialization data (var_hash) is
not the same (you can't use unserialized references...). Try this:
$n = gmp_init(42);
$n->obj = $n;
var_dump(unserialize(serialize($n)));
(you will get really cool animation when you run it... :) )
My patch is not match better as I am getting segfault. :) I will probably
have to do a bit more testing... :)
Jakub