xref: /PHP-7.4/ext/opcache/tests/bug78185.phpt (revision 75bc3446)
1--TEST--
2Bug #78185: file cache only no longer works
3--INI--
4opcache.enable_cli=1
5opcache.optimization_level=-1
6opcache.file_cache={PWD}
7opcache.file_cache_only=1
8--SKIPIF--
9<?php require_once('skipif.inc'); ?>
10--FILE--
11<?php
12if (substr(PHP_OS, 0, 3) !== 'WIN') {
13	$pattern = __DIR__ . '/*/' . __DIR__ . '/*78185.php.bin';
14} else {
15	$pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*78185.php.bin';
16}
17foreach (glob($pattern) as $p) {
18	var_dump($p);
19}
20?>
21--CLEAN--
22<?php
23if (substr(PHP_OS, 0, 3) !== 'WIN') {
24	$pattern = __DIR__ . '/*/' . __DIR__ . '/*78185.php.bin';
25} else {
26	$pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*78185.php.bin';
27}
28foreach (glob($pattern) as $p) {
29	unlink($p);
30	$p = dirname($p);
31	while(strlen($p) > strlen(__DIR__)) {
32		rmdir($p);
33		$p = dirname($p);
34	}
35}
36?>
37--EXPECTF--
38string(%d) "%s78185.php.bin"
39
40