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