2008-02-06 08:44:24 +00:00
|
|
|
--TEST--
|
2009-01-12 17:56:28 +00:00
|
|
|
Test srand() - basic function test for srand()
|
2008-02-06 08:44:24 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2009-01-12 17:56:28 +00:00
|
|
|
/* Prototype : void srand ([ int $seed ] )
|
|
|
|
* Description: Seed the random number generator.
|
|
|
|
* Source code: ext/standard/rand.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
echo "*** Testing srand() : basic functionality ***\n";
|
|
|
|
|
2008-02-06 08:44:24 +00:00
|
|
|
// Should return NULL if given anything that it can convert to long
|
|
|
|
// This doesn't actually test what it does with the input :-\
|
|
|
|
var_dump(srand());
|
|
|
|
var_dump(srand(500));
|
|
|
|
var_dump(srand(500.1));
|
|
|
|
var_dump(srand("500"));
|
|
|
|
var_dump(srand("500E3"));
|
|
|
|
var_dump(srand(true));
|
|
|
|
var_dump(srand(false));
|
|
|
|
var_dump(srand(NULL));
|
|
|
|
?>
|
2009-01-12 17:56:28 +00:00
|
|
|
===Done===
|
2008-02-06 08:44:24 +00:00
|
|
|
--EXPECTF--
|
2009-01-12 17:56:28 +00:00
|
|
|
*** Testing srand() : basic functionality ***
|
2008-02-06 08:44:24 +00:00
|
|
|
NULL
|
|
|
|
NULL
|
|
|
|
NULL
|
|
|
|
NULL
|
|
|
|
NULL
|
|
|
|
NULL
|
|
|
|
NULL
|
2009-01-12 17:56:28 +00:00
|
|
|
NULL
|
|
|
|
===Done===
|