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/* test is_executable() with invalid arguments */
13
14echo "*** Testing is_executable(): usage variations ***\n";
15
16$file_handle = fopen(__FILE__, "r");
17unset($file_handle);
18
19echo "\n*** Testing is_executable() on invalid files ***\n";
20$invalid_files = array(
21  0,
22  1234,
23  -2.34555,
24  TRUE,
25  FALSE,
26  NULL,
27  " ",
28  @$file_handle
29);
30/* loop through to test each element in the above array
31   is an executable file */
32foreach( $invalid_files as $invalid_file ) {
33  var_dump( is_executable($invalid_file) );
34  clearstatcache();
35}
36
37echo "Done\n";
38?>
39--EXPECT--
40*** Testing is_executable(): usage variations ***
41
42*** Testing is_executable() on invalid files ***
43bool(false)
44bool(false)
45bool(false)
46bool(false)
47bool(false)
48bool(false)
49bool(false)
50bool(false)
51Done
52