1--TEST--
2Test is_executable() function: usage variations - invalid file names
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) == 'WIN') {
6    die('skip not for windows');
7}
8require __DIR__ . '/../skipif_root.inc';
9?>
10--FILE--
11<?php
12/* Prototype: bool is_executable ( string $filename );
13   Description: Tells whether the filename is executable
14*/
15
16/* test is_executable() with invalid arguments */
17
18echo "*** Testing is_executable(): usage variations ***\n";
19
20$file_handle = fopen(__FILE__, "r");
21unset($file_handle);
22
23echo "\n*** Testing is_executable() on invalid files ***\n";
24$invalid_files = array(
25  0,
26  1234,
27  -2.34555,
28  TRUE,
29  FALSE,
30  NULL,
31  " ",
32  @array(),
33  @$file_handle
34);
35/* loop through to test each element in the above array
36   is an executable file */
37foreach( $invalid_files as $invalid_file ) {
38  var_dump( is_executable($invalid_file) );
39  clearstatcache();
40}
41
42echo "Done\n";
43?>
44--EXPECTF--
45*** Testing is_executable(): usage variations ***
46
47*** Testing is_executable() on invalid files ***
48bool(false)
49bool(false)
50bool(false)
51bool(false)
52bool(false)
53bool(false)
54bool(false)
55
56Warning: is_executable() expects parameter 1 to be a valid path, array given in %s on line %d
57NULL
58bool(false)
59Done
60