1--TEST--
2Test filetype() function: Error conditions
3--FILE--
4<?php
5/*
6Prototype: string filetype ( string $filename );
7Description: Returns the type of the file. Possible values are fifo, char,
8             dir, block, link, file, and unknown.
9*/
10
11echo "*** Testing error conditions ***";
12/* non-existing file or dir */
13print( filetype("/no/such/file/dir") );
14
15/* unknown type */
16print( filetype("string") );
17print( filetype(100) );
18
19/* No.of args less than expected */
20print( filetype() );
21
22/* No.of args greater than expected */
23print( filetype("file", "file") );
24
25echo "\n*** Done ***\n";
26?>
27--EXPECTF--
28*** Testing error conditions ***
29Warning: filetype(): Lstat failed for /no/such/file/dir in %s on line %d
30
31Warning: filetype(): Lstat failed for string in %s on line %d
32
33Warning: filetype(): Lstat failed for 100 in %s on line %d
34
35Warning: filetype() expects exactly 1 parameter, 0 given in %s on line %d
36
37Warning: filetype() expects exactly 1 parameter, 2 given in %s on line %d
38
39*** Done ***
40