We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75ffba9 commit b937674Copy full SHA for b937674
tests/MaxMind/Db/Test/Reader/DecoderTest.php
@@ -306,7 +306,14 @@ public function generateLargeUint(int $bits): array
306
307
for ($power = 1; $power <= $bits / 8; ++$power) {
308
if (\extension_loaded('gmp')) {
309
- $expected = gmp_strval(gmp_sub(gmp_pow('2', 8 * $power), '1'));
+ // This is to work around the limit added to gmp_pow here:
310
+ // https://github.com/php/php-src/commit/e0a0e216a909dc4ee4ea7c113a5f41d49525f02e
311
+ $v = 1;
312
+ for ($i = 0; $i < $power; $i++) {
313
+ $v = gmp_mul($v, 256);
314
+ }
315
+
316
+ $expected = gmp_strval(gmp_sub($v, '1'));
317
} elseif (\extension_loaded('bcmath')) {
318
$expected = bcsub(bcpow('2', (string) (8 * $power)), '1');
319
} else {
0 commit comments