1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 22:41:20 +02:00
Files
archived-php-src/ext/gmp/tests/bug67917.phpt
2018-02-03 13:54:34 +01:00

20 lines
389 B
PHP

--TEST--
Bug #67917: Using GMP objects with overloaded operators can cause memory exhaustion
--SKIPIF--
<?php if (!extension_loaded('gmp')) die('skip gmp extension not loaded'); ?>
--FILE--
<?php
$mem1 = memory_get_usage();
for ($i = 0; $i < 1000; $i++) {
$gmp = gmp_init(42);
$gmp <<= 1;
}
$mem2 = memory_get_usage();
var_dump($mem2 - $mem1 < 100000);
?>
--EXPECT--
bool(true)