1--TEST--
2Test filesize() function: error conditions
3--FILE--
4<?php
5/*
6 * Prototype   : int filesize ( string $filename );
7 * Description : Returns the size of the file in bytes, or FALSE
8 *               (and generates an error of level E_WARNING) in case of an error.
9 */
10
11echo "*** Testing filesize(): error conditions ***";
12
13/* Non-existing file or dir */
14var_dump( filesize("/no/such/file") );
15var_dump( filesize("/no/such/dir") );
16
17/* No.of arguments less than expected */
18var_dump( filesize() );
19
20/* No.of arguments greater than expected */
21var_dump( filesize(__FILE__, 2000) );
22echo "\n";
23
24echo "*** Done ***\n";
25?>
26--EXPECTF--
27*** Testing filesize(): error conditions ***
28Warning: filesize(): stat failed for /no/such/file in %s on line %d
29bool(false)
30
31Warning: filesize(): stat failed for /no/such/dir in %s on line %d
32bool(false)
33
34Warning: filesize() expects exactly 1 parameter, 0 given in %s on line %d
35NULL
36
37Warning: filesize() expects exactly 1 parameter, 2 given in %s on line %d
38NULL
39
40*** Done ***
41
42