2007-04-19 05:04:21 +08:00
|
|
|
--TEST--
|
|
|
|
gmp_random() basic tests
|
2007-05-27 23:12:33 +08:00
|
|
|
--SKIPIF--
|
|
|
|
<?php if (!extension_loaded("gmp")) print "skip"; ?>
|
2007-04-19 05:04:21 +08:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
var_dump(gmp_strval(gmp_random()));
|
|
|
|
var_dump(gmp_strval(gmp_random(-1)));
|
|
|
|
var_dump(gmp_strval(gmp_random(0)));
|
|
|
|
var_dump(gmp_strval(gmp_random(10)));
|
|
|
|
var_dump(gmp_strval(gmp_random("-10")));
|
|
|
|
var_dump(gmp_strval(gmp_random(-10)));
|
|
|
|
|
|
|
|
var_dump(gmp_random(array()));
|
|
|
|
var_dump(gmp_random(array(),1));
|
|
|
|
var_dump(gmp_random(""));
|
|
|
|
var_dump(gmp_random("test"));
|
|
|
|
|
|
|
|
echo "Done\n";
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
|
|
|
string(%d) "%d"
|
|
|
|
string(%d) "%d"
|
|
|
|
string(1) "%d"
|
|
|
|
string(%d) "%d"
|
|
|
|
string(%d) "%d"
|
|
|
|
string(%d) "%d"
|
|
|
|
|
2007-11-01 08:46:13 +08:00
|
|
|
Warning: gmp_random() expects parameter 1 to be long, array given in %s on line %d
|
|
|
|
NULL
|
|
|
|
|
|
|
|
Warning: gmp_random() expects at most 1 parameter, 2 given in %s on line %d
|
|
|
|
NULL
|
|
|
|
|
|
|
|
Warning: gmp_random() expects parameter 1 to be long, string given in %s on line %d
|
|
|
|
NULL
|
|
|
|
|
|
|
|
Warning: gmp_random() expects parameter 1 to be long, string given in %s on line %d
|
2007-04-19 05:04:21 +08:00
|
|
|
NULL
|
|
|
|
Done
|