php-src/ext/gmp/tests/bug659967.phpt
Nikita Popov 4218e89f8d Fix bug #65997 by switching to Serializable for GMP
Rather than using get_properties and __wakeup for serialization
the code now uses Serializable::serialize() and
Serializable::unserialize(). The get_properties handler is switched
to a get_debug_info handler. Thus get_gc will now return only
the normal properties and not do any modifications, thus fixing
the leak. This also avoids a $num property from being publicly
visible after the object was dumped or serialized, so that's an
extra plus.
2013-10-29 20:58:30 +01:00

16 lines
257 B
PHP

--TEST--
Bug #65997: Leak when using gc_collect_cycles with new GMP implementation
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
--FILE--
<?php
gc_enable();
$gmp = gmp_init('10');
gc_collect_cycles();
?>
===DONE===
--EXPECT--
===DONE===