Skip to content

Commit ca2c359

Browse files
committed
Add test case for opcache revalidation in cli
1 parent 7cf0106 commit ca2c359

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
--TEST--
2+
opcache revalidation should work properly in CLI mode
3+
--EXTENSIONS--
4+
opcache
5+
--INI--
6+
opcache.enable=1
7+
opcache.enable_cli=1
8+
opcache.validate_timestamps=1
9+
opcache.revalidate_freq=1
10+
--FILE--
11+
<?php
12+
$file = __DIR__ . DIRECTORY_SEPARATOR . pathinfo(__FILE__, PATHINFO_FILENAME) . '.inc';
13+
14+
file_put_contents($file, <<<PHP
15+
<?php
16+
return 42;
17+
PHP);
18+
var_dump(include $file);
19+
20+
file_put_contents($file, <<<PHP
21+
<?php
22+
return 1234;
23+
PHP);
24+
25+
var_dump(include $file);
26+
27+
sleep(2);
28+
touch($file);
29+
30+
var_dump(include $file);
31+
32+
?>
33+
--EXPECT--
34+
int(42)
35+
int(42)
36+
int(1234)

0 commit comments

Comments
 (0)