import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-strings / str_shuffle_variation1.php
blobc0aaab2a0c7b92082a74e61cac6bfc081716f39c
1 <?php
3 /* Prototype : string str_shuffle ( string $str )
4 * Description: Randomly shuffles a string
5 * Source code: ext/standard/string.c
6 */
8 echo "*** Testing str_shuffle() function: with unexpected inputs for 'string' argument ***\n";
10 //get an unset variable
11 $unset_var = 'string_val';
12 unset($unset_var);
14 //defining a class
15 class sample {
16 public function __toString() {
17 return "sample object";
21 //getting the resource
22 $file_handle = fopen(__FILE__, "r");
24 // array with different values for $input
25 $inputs = array (
27 // integer values
28 /*1*/ 0,
30 -2,
31 2147483647,
32 -2147483648,
34 // float values
35 /*6*/ 10.5,
36 -20.5,
37 10.1234567e10,
39 // array values
40 /*9*/ array(),
41 array(0),
42 array(1, 2),
44 // boolean values
45 /*12*/ true,
46 false,
47 TRUE,
48 FALSE,
50 // null vlaues
51 /*16*/ NULL,
52 null,
54 // objects
55 /*18*/ new sample(),
57 // resource
58 /*19*/ $file_handle,
60 // undefined variable
61 /*20*/ @$undefined_var,
63 // unset variable
64 /*21*/ @$unset_var
68 // loop through with each element of the $inputs array to test str_shuffle() function
69 $count = 1;
70 foreach($inputs as $input) {
71 echo "-- Iteration $count --\n";
72 var_dump( str_shuffle($input) );
73 $count ++;
76 fclose($file_handle); //closing the file handle
79 ===DONE===