1--TEST-- 2gmp_nextprime() 3--SKIPIF-- 4<?php if (!extension_loaded("gmp")) print "skip"; 5if(substr(PHP_OS, 0, 3) != 'WIN' ) { 6 die('skip windows only test'); 7} 8?> 9--FILE-- 10<?php 11 12$n = gmp_nextprime(-1); 13var_dump(gmp_strval($n)); 14$n = gmp_nextprime(0); 15var_dump(gmp_strval($n)); 16$n = gmp_nextprime(-1000); 17var_dump(gmp_strval($n)); 18$n = gmp_nextprime(1000); 19var_dump(gmp_strval($n)); 20$n = gmp_nextprime(100000); 21var_dump(gmp_strval($n)); 22$n = gmp_nextprime(array()); 23var_dump(gmp_strval($n)); 24$n = gmp_nextprime(""); 25var_dump(gmp_strval($n)); 26$n = gmp_nextprime(new stdclass()); 27var_dump(gmp_strval($n)); 28 29echo "Done\n"; 30?> 31--EXPECTF-- 32string(1) "2" 33string(1) "2" 34string(4) "-997" 35string(4) "1009" 36string(6) "100003" 37 38Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d 39string(1) "0" 40string(1) "0" 41 42Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d 43string(1) "0" 44Done 45 46