xref: /PHP-7.2/ext/gmp/bug67917.phpt (revision fc5f9316)
1--TEST--
2Bug #67917: Using GMP objects with overloaded operators can cause memory exhaustion
3--FILE--
4<?php
5
6$mem1 = memory_get_usage();
7for ($i = 0; $i < 1000; $i++) {
8    $gmp = gmp_init(42);
9    $gmp <<= 1;
10}
11$mem2 = memory_get_usage();
12
13var_dump($mem2 - $mem1 < 100000);
14
15?>
16--EXPECT--
17bool(true)
18