1--TEST--
2Bug #71103 file_exists and is_readable fail silently
3--SKIPIF--
4<?php
5include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
6
7skip_if_not_win();
8if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
9
10?>
11--FILE--
12<?php
13
14$base = __DIR__;
15$d = $base . '\\dev\\http\\tproj\\app\\cache\\dev_old\\annotations\\72';
16
17$foo = $d . '\\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726f6c6c65725c457863657074696f6e436f6e74726f6c6c657223676574416e64436c65616e4f7574707574427566666572696e67405b416e6e6f745d5d5b.doctrinecache.data';
18$bar = $d . '\\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726f6c6c65725c457863657074696f6e436f6e74726f6c6c657223676574416e64436c65616e4f7574707574427566666572696e67405b416e6e6f745d5d5b315d.doctrinecache.data';
19
20mkdir($d, NULL, true);
21
22foreach (array($foo, $bar) as $f) {
23	touch($f);
24
25	$foo_obj = new \SplFileInfo($f);
26	var_dump(
27		$f,
28		strlen($f) > 260, /* exceeds _MAX_PATH */
29		file_exists($f),
30		file_exists($foo_obj),
31		is_readable($f),
32		is_readable($foo_obj),
33		is_writable($f),
34		is_writable($foo_obj)
35	);
36
37	unlink($f);
38}
39
40$p = $d;
41do {
42	rmdir($p);
43	$p = dirname($p);
44} while ($p != $base);
45
46?>
47===DONE===
48--EXPECTF--
49string(%d) "%s\dev\http\tproj\app\cache\dev_old\annotations\72\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726f6c6c65725c457863657074696f6e436f6e74726f6c6c657223676574416e64436c65616e4f7574707574427566666572696e67405b416e6e6f745d5d5b.doctrinecache.data"
50bool(true)
51bool(true)
52bool(true)
53bool(true)
54bool(true)
55bool(true)
56bool(true)
57string(%d) "%s\dev\http\tproj\app\cache\dev_old\annotations\72\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726f6c6c65725c457863657074696f6e436f6e74726f6c6c657223676574416e64436c65616e4f7574707574427566666572696e67405b416e6e6f745d5d5b315d.doctrinecache.data"
58bool(true)
59bool(true)
60bool(true)
61bool(true)
62bool(true)
63bool(true)
64bool(true)
65===DONE===
66