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