import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-math / mt_srand_variation1.php
blobe4ea4a250583fbc6ddafe571a6c8f426a4a2285e
1 <?php
2 /* Prototype : void mt_srand ([ int $seed ] )
3 * Description: Seed the better random number generator.
4 * Source code: ext/standard/rand.c
5 */
7 echo "*** Testing mt_srand() : usage variations ***\n";
9 //get an unset variable
10 $unset_var = 10;
11 unset ($unset_var);
13 // heredoc string
14 $heredoc = <<<EOT
15 abc
16 xyz
17 EOT;
19 // get a class
20 class classA
24 // get a resource variable
25 $fp = fopen(__FILE__, "r");
27 $inputs = array(
28 // int data
29 /*1*/ 0,
31 12345,
32 -2345,
33 2147483647,
35 // float data
36 /*6*/ 10.5,
37 -10.5,
38 12.3456789000e10,
39 12.3456789000E-10,
40 .5,
42 // null data
43 /*11*/ NULL,
44 null,
46 // boolean data
47 /*13*/ true,
48 false,
49 TRUE,
50 FALSE,
52 // empty data
53 /*17*/ "",
54 '',
55 array(),
57 // string data
58 /*20*/ "abcxyz",
59 'abcxyz',
60 $heredoc,
62 // object data
63 /*23*/ new classA(),
65 // undefined data
66 /*24*/ @$undefined_var,
68 // unset data
69 /*25*/ @$unset_var,
71 // resource variable
72 /*26*/ $fp
75 // loop through each element of $inputs to check the behaviour of mt_srand()
76 $iterator = 1;
77 foreach($inputs as $input) {
78 echo "\n-- Iteration $iterator --\n";
79 var_dump(mt_srand($input));
80 $iterator++;
82 fclose($fp);
84 ===Done===