Annotation of embedaddon/php/ext/gmp/tests/gmp_nextprime.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: gmp_nextprime()
3: --SKIPIF--
4: <?php if (!extension_loaded("gmp")) print "skip"; ?>
5: --FILE--
6: <?php
7:
8: $n = gmp_nextprime(-1);
9: var_dump(gmp_strval($n));
10: $n = gmp_nextprime(0);
11: var_dump(gmp_strval($n));
12: $n = gmp_nextprime(-1000);
13: var_dump(gmp_strval($n));
14: $n = gmp_nextprime(1000);
15: var_dump(gmp_strval($n));
16: $n = gmp_nextprime(100000);
17: var_dump(gmp_strval($n));
18: $n = gmp_nextprime(array());
19: var_dump(gmp_strval($n));
20: $n = gmp_nextprime("");
21: var_dump(gmp_strval($n));
22: $n = gmp_nextprime(new stdclass());
23: var_dump(gmp_strval($n));
24:
25: echo "Done\n";
26: ?>
27: --EXPECTF--
28: string(1) "2"
29: string(1) "2"
30: string(1) "2"
31: string(4) "1009"
32: string(6) "100003"
33:
34: Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
35: string(1) "0"
36: string(1) "0"
37:
38: Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
39: string(1) "0"
40: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>