Remove support for variable variables from parser, typechecker and frontend
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / dir / readdir_variation4.php
blob631d5b27f512ae387bcaa2321af61b2be2a145cb
1 <?php
2 /* Prototype : string readdir([resource $dir_handle])
3 * Description: Read directory entry from dir_handle
4 * Source code: ext/standard/dir.c
5 */
7 /*
8 * Pass a directory handle pointing to a directory that contains
9 * files with different file names to test how readdir() reads them
12 echo "*** Testing readdir() : usage variations ***\n";
14 $dir_path = dirname(__FILE__) . "/readdir_variation4/";
15 mkdir($dir_path);
17 // heredoc string
18 $heredoc = <<<EOT
19 hd_file
20 EOT;
22 $inputs = array(
24 // int data
25 /*1*/ 0,
27 12345,
28 -2345,
30 // float data
31 /*5*/ 10.5,
32 -10.5,
33 12.3456789000e10,
34 12.3456789000E-10,
35 .5,
37 // empty data
38 /*10*/ "",
39 array(),
41 // string data
42 /*12*/ "double_file",
43 'single_file',
44 $heredoc,
47 $iterator = 1;
48 foreach($inputs as $key => $input) {
49 echo "\n-- Iteration $iterator --\n";
50 $handle = "fp{$iterator}";
51 var_dump( $handle = fopen(@"$dir_path$input.tmp", 'w') );
52 var_dump( fwrite($handle, $key));
53 fclose($handle);
54 $iterator++;
57 echo "\n-- Call to readdir() --\n";
58 $dir_handle = opendir($dir_path);
59 while(FALSE !== ($file = readdir($dir_handle))){
61 // different OS order files differently so will
62 // store file names into an array so can use sorted in expected output
63 $contents[] = $file;
65 // remove files while going through directory
66 @unlink($dir_path . $file);
69 // more important to check that all contents are present than order they are returned in
70 sort(&$contents);
71 var_dump($contents);
73 closedir($dir_handle);
75 ===DONE===
76 <?php error_reporting(0); ?>
77 <?php
78 $dir_path = dirname(__FILE__) . "/readdir_variation4/";
79 rmdir($dir_path);