1--TEST--
2Test is_writable() and its alias is_writeable() function: usage variations - invalid file names
3--SKIPIF--
4<?php
5require __DIR__ . '/../skipif_root.inc';
6?>
7--CONFLICTS--
8obscure_filename
9--FILE--
10<?php
11/* Prototype: bool is_writable ( string $filename );
12   Description: Tells whether the filename is writable.
13
14   is_writeable() is an alias of is_writable()
15*/
16
17/* test is_writable() & is_writeable() with invalid arguments */
18
19echo "*** Testing is_writable(): usage variations ***\n";
20
21echo "\n*** Testing is_writable() with invalid filenames ***\n";
22$misc_files = array(
23  0,
24  1234,
25  -2.34555,
26  TRUE,
27  FALSE,
28  NULL,
29  " ",
30  @array(),
31  @$file_handle
32);
33/* loop through to test each element in the above array
34   is a writable file */
35foreach( $misc_files as $misc_file ) {
36  var_dump( is_writable($misc_file) );
37  var_dump( is_writeable($misc_file) );
38  clearstatcache();
39}
40?>
41--EXPECTF--
42*** Testing is_writable(): usage variations ***
43
44*** Testing is_writable() with invalid filenames ***
45bool(false)
46bool(false)
47bool(false)
48bool(false)
49bool(false)
50bool(false)
51bool(false)
52bool(false)
53bool(false)
54bool(false)
55bool(false)
56bool(false)
57bool(false)
58bool(false)
59
60Warning: is_writable() expects parameter 1 to be a valid path, array given in %s on line %d
61NULL
62
63Warning: is_writeable() expects parameter 1 to be a valid path, array given in %s on line %d
64NULL
65bool(false)
66bool(false)
67