Skip to content

Commit e7386aa

Browse files
committed
add a test with gmp and PHP_INT_MAX
1 parent 20e15f5 commit e7386aa

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

ext/gmp/tests/gmp_php_int_max.phpt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
PHP_INT_MAX tests
3+
--SKIPIF--
4+
<?php if (!extension_loaded("gmp")) print "skip"; ?>
5+
--FILE--
6+
<?php
7+
8+
var_dump(gmp_mul(PHP_INT_MAX, PHP_INT_MAX));
9+
var_dump(gmp_add(PHP_INT_MAX, PHP_INT_MAX));
10+
var_dump(gmp_mul(PHP_INT_MAX, PHP_INT_MIN));
11+
?>
12+
DONE
13+
--EXPECTF--
14+
object(GMP)#%d (%d) {
15+
["num"]=>
16+
string(38) "85070591730234615847396907784232501249"
17+
}
18+
object(GMP)#%d (%d) {
19+
["num"]=>
20+
string(20) "18446744073709551614"
21+
}
22+
object(GMP)#%d (%d) {
23+
["num"]=>
24+
string(39) "-85070591730234615856620279821087277056"
25+
}
26+
DONE

0 commit comments

Comments
 (0)