xref: /PHP-8.0/ext/standard/tests/file/005_error.phpt (revision b5c7a83d)
1--TEST--
2Test fileatime(), filemtime(), filectime() & touch() functions : error conditions
3--FILE--
4<?php
5
6echo "*** Testing error conditions ***\n";
7
8echo "\n-- Testing with  Non-existing files --";
9/* Both invalid arguments */
10var_dump( fileatime("/no/such/file/or/dir") );
11var_dump( filemtime("/no/such/file/or/dir") );
12var_dump( filectime("/no/such/file/or/dir") );
13var_dump( touch("/no/such/file/or/dir", 10) );
14
15echo "\nDone";
16?>
17--EXPECTF--
18*** Testing error conditions ***
19
20-- Testing with  Non-existing files --
21Warning: fileatime(): stat failed for /no/such/file/or/dir in %s on line %d
22bool(false)
23
24Warning: filemtime(): stat failed for /no/such/file/or/dir in %s on line %d
25bool(false)
26
27Warning: filectime(): stat failed for /no/such/file/or/dir in %s on line %d
28bool(false)
29
30Warning: touch(): Unable to create file /no/such/file/or/dir because No such file or directory in %s on line %d
31bool(false)
32
33Done
34