xref: /PHP-8.1/ext/gmp/tests/bug69803.phpt (revision e9f783fc)
1--TEST--
2Bug #69803: gmp_random_range() modifies second parameter if GMP number
3--EXTENSIONS--
4gmp
5--FILE--
6<?php
7
8$a = gmp_init(100);
9$b = gmp_init(200);
10echo $a . ", ", $b . "\n";
11gmp_random_range($a, $b);
12echo $a . ", ", $b . "\n";
13
14$b = gmp_init(200);
15echo $a . ", ", $b . "\n";
16gmp_random_range(100, $b);
17echo $a . ", ", $b . "\n";
18
19?>
20--EXPECT--
21100, 200
22100, 200
23100, 200
24100, 200
25