summaryrefslogtreecommitdiff
path: root/ext/gmp/tests/gmp_nextprime.phpt
blob: da89221c0af86783ed05c85e9ff0582adf858957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--TEST--
gmp_nextprime()
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip";
?>
--FILE--
<?php

$n = gmp_nextprime(-1);
var_dump(gmp_strval($n));
$n = gmp_nextprime(0);
var_dump(gmp_strval($n));
$n = gmp_nextprime(-1000);
var_dump(gmp_strval($n));
$n = gmp_nextprime(1000);
var_dump(gmp_strval($n));
$n = gmp_nextprime(100000);
var_dump(gmp_strval($n));
$n = gmp_nextprime(array());
var_dump(gmp_strval($n));
$n = gmp_nextprime("");
var_dump(gmp_strval($n));
$n = gmp_nextprime(new stdclass());
var_dump(gmp_strval($n));
	
echo "Done\n";
?>
--EXPECTF--	
string(1) "2"
string(1) "2"
string(1) "2"
string(4) "1009"
string(6) "100003"

Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
string(1) "0"

Warning: gmp_nextprime(): Unable to convert variable to GMP - string is not an integer in %s on line %d
string(1) "0"

Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
string(1) "0"
Done