Annotation of embedaddon/php/ext/standard/tests/file/lstat_stat_variation22.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Test lstat() and stat() functions: usage variations - invalid filenames
3: --CREDITS--
4: Dave Kelsey <d_kelsey@uk.ibm.com>
1.1.1.2 ! misho 5: --SKIPIF--
! 6: <?php
! 7: if (substr(PHP_OS, 0, 3) == 'WIN') {
! 8: die('skip ... not for Windows');
! 9: }
1.1 misho 10: --FILE--
11: <?php
12: /* Prototype: array lstat ( string $filename );
13: Description: Gives information about a file or symbolic link
14:
15: Prototype: array stat ( string $filename );
16: Description: Gives information about a file
17: */
18: echo "*** testing stat ***\n";
19: var_dump(stat(NULL));
20: var_dump(stat(false));
21: var_dump(stat(''));
22: var_dump(stat(' '));
23: var_dump(stat('|'));
24:
25: echo "*** testing lstat ***\n";
26: var_dump(lstat(NULL));
27: var_dump(lstat(false));
28: var_dump(lstat(''));
29: var_dump(lstat(' '));
30: var_dump(lstat('|'));
31: echo "Done";
32: ?>
33: --EXPECTF--
34: *** testing stat ***
35: bool(false)
36: bool(false)
37: bool(false)
38:
39: Warning: stat(): stat failed for in %s on line %d
40: bool(false)
41:
42: Warning: stat(): stat failed for | in %s on line %d
43: bool(false)
44: *** testing lstat ***
45: bool(false)
46: bool(false)
47: bool(false)
48:
49: Warning: lstat(): Lstat failed for in %s on line %d
50: bool(false)
51:
52: Warning: lstat(): Lstat failed for | in %s on line %d
53: bool(false)
1.1.1.2 ! misho 54: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>