xref: /PHP-8.1/ext/opcache/tests/bug78185.phpt (revision e9f783fc)
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
8opcache.jit=0
9--EXTENSIONS--
10opcache
11--FILE--
12<?php
13if (substr(PHP_OS, 0, 3) !== 'WIN') {
14    $pattern = __DIR__ . '/*/' . __DIR__ . '/*78185.php.bin';
15} else {
16    $pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*78185.php.bin';
17}
18foreach (glob($pattern) as $p) {
19    var_dump($p);
20}
21?>
22--CLEAN--
23<?php
24if (substr(PHP_OS, 0, 3) !== 'WIN') {
25    $pattern = __DIR__ . '/*/' . __DIR__ . '/*78185.php.bin';
26} else {
27    $pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*78185.php.bin';
28}
29foreach (glob($pattern) as $p) {
30    unlink($p);
31    $p = dirname($p);
32    while(strlen($p) > strlen(__DIR__)) {
33        rmdir($p);
34        $p = dirname($p);
35    }
36}
37?>
38--EXPECTF--
39string(%d) "%s78185.php.bin"
40
41