1--TEST-- 2Test is_dir() function: usage variations - dir/subdir 3--FILE-- 4<?php 5/* Prototype: bool is_dir ( string $dirname ); 6 Description: Tells whether the dirname is a directory 7 Returns TRUE if the dirname exists and is a directory, FALSE otherwise. 8*/ 9 10/* Testing is_dir() with base and sub dirs */ 11 12$file_path = dirname(__FILE__); 13 14echo "-- Testing is_dir() with an empty dir --\n"; 15$dirname = $file_path."/is_dir_variation1"; 16mkdir($dirname); 17var_dump( is_dir($dirname) ); 18clearstatcache(); 19 20echo "-- Testing is_dir() with a subdir in base dir --\n"; 21$subdirname = $dirname."/is_dir_variation1_sub"; 22mkdir($subdirname); 23var_dump( is_dir($subdirname) ); 24var_dump( is_dir($dirname) ); 25 26echo "\n*** Done ***"; 27?> 28--CLEAN-- 29<?php 30$file_path = dirname(__FILE__); 31$dir_name = $file_path."/is_dir_variation1"; 32rmdir($dir_name."/is_dir_variation1_sub"); 33rmdir($dir_name); 34?> 35--EXPECTF-- 36-- Testing is_dir() with an empty dir -- 37bool(true) 38-- Testing is_dir() with a subdir in base dir -- 39bool(true) 40bool(true) 41 42*** Done *** 43