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 6339668 commit 9282503Copy full SHA for 9282503
ext/gmp/tests/gmp_pow_fpe.phpt
@@ -6,15 +6,17 @@ gmp
6
<?php
7
$g = gmp_init(256);
8
9
-var_dump(gmp_pow($g, PHP_INT_MAX));
10
-var_dump(gmp_pow(256, PHP_INT_MAX));
11
-?>
12
---EXPECTF--
13
-object(GMP)#2 (1) {
14
- ["num"]=>
15
- string(%d) "%s"
+try {
+ gmp_pow($g, PHP_INT_MAX);
+} catch (\ValueError $e) {
+ echo $e->getMessage() . PHP_EOL;
16
}
17
18
19
+ gmp_pow(256, PHP_INT_MAX);
+ echo $e->getMessage();
20
+?>
+--EXPECT--
21
+base and exponent overflow
22
0 commit comments