Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / standard / tests / streams / stream_get_meta_data_file_variation4.phpt
blobc51d9bd087243a7a84b649dd8d9df46f95bc1ce5
1 --TEST--
2 stream_get_meta_data() with a relative file path
3 --FILE--
4 <?php
6 echo "Create a file:\n";
7 $filename = __FILE__ . '.tmp';
8 $fp = fopen('File://' . $filename, 'w+');
10 var_dump(stream_get_meta_data($fp));
12 fclose($fp);
14 echo "\nChange to file's directory and open with a relative path:\n";
16 $dirname = dirname($filename);
17 chdir($dirname);
18 $relative_filename = basename($filename);
20 $fp = fopen($relative_filename, 'r');
21 var_dump(stream_get_meta_data($fp));
23 fclose($fp);
25 unlink($filename);
28 --EXPECTF--
29 Create a file:
30 array(9) {
31   ["wrapper_type"]=>
32   string(9) "plainfile"
33   ["stream_type"]=>
34   string(5) "STDIO"
35   ["mode"]=>
36   string(2) "w+"
37   ["unread_bytes"]=>
38   int(0)
39   ["seekable"]=>
40   bool(true)
41   ["uri"]=>
42   string(%i) "File://%sstream_get_meta_data_file_variation4.php.tmp"
43   ["timed_out"]=>
44   bool(false)
45   ["blocked"]=>
46   bool(true)
47   ["eof"]=>
48   bool(false)
51 Change to file's directory and open with a relative path:
52 array(9) {
53   ["wrapper_type"]=>
54   string(9) "plainfile"
55   ["stream_type"]=>
56   string(5) "STDIO"
57   ["mode"]=>
58   string(1) "r"
59   ["unread_bytes"]=>
60   int(0)
61   ["seekable"]=>
62   bool(true)
63   ["uri"]=>
64   string(%i) "stream_get_meta_data_file_variation4.php.tmp"
65   ["timed_out"]=>
66   bool(false)
67   ["blocked"]=>
68   bool(true)
69   ["eof"]=>
70   bool(false)