2 /* Prototype: bool is_file ( string $filename );
3 Description: Tells whether the filename is a regular file
4 Returns TRUE if the filename exists and is a regular file
6 <<__EntryPoint
>> function main(): void
{
7 echo "*** Testing is_file(): basic functionality ***\n";
9 /* Checking with current file */
10 var_dump( is_file(__FILE__
) );
12 /* Checking with (current) dir */
13 var_dump( is_file(dirname(__FILE__
)) );
15 $file_name = __SystemLib\
hphp_test_tmppath('is_file_basic.tmp');
16 /* With non-existing file */
17 var_dump( is_file($file_name) );
18 /* With existing file */
19 fclose( fopen($file_name, "w") );
20 var_dump( is_file($file_name) );
22 echo "*** Testing is_file() for its return value type ***\n";
23 var_dump( is_bool( is_file(__FILE__
) ) );
24 var_dump( is_bool( is_file("/no/such/file") ) );
26 echo "\n*** Done ***";