1--TEST--
2Test is_dir() function: basic functionality
3--FILE--
4<?php
5/* Prototype: bool is_dir ( string $filename );
6   Description: Tells whether the filename is a regular file
7     Returns TRUE if the filename exists and is a regular file
8*/
9
10echo "*** Testing is_dir(): basic functionality ***\n";
11$file_path = dirname(__FILE__);
12var_dump( is_dir($file_path) );
13clearstatcache();
14var_dump( is_dir(".") );
15var_dump( is_dir(__FILE__) );  // expected: bool(false)
16
17$dir_name = $file_path."/is_dir_basic";
18mkdir($dir_name);
19var_dump( is_dir($dir_name) );
20
21echo "*** Testing is_dir() for its return value type ***\n";
22var_dump( is_bool( is_dir($file_path) ) );
23var_dump( is_bool( is_dir("/no/such/dir") ) );
24
25echo "*** Done ***";
26?>
27--CLEAN--
28<?php
29$file_path = dirname(__FILE__);
30$dir_name = $file_path."/is_dir_basic";
31rmdir($dir_name);
32?>
33--EXPECTF--
34*** Testing is_dir(): basic functionality ***
35bool(true)
36bool(true)
37bool(false)
38bool(true)
39*** Testing is_dir() for its return value type ***
40bool(true)
41bool(true)
42*** Done ***
43