xref: /PHP-7.1/ext/opcache/tests/issue0140.phpt (revision 9fa1ab1b)
1--TEST--
2Issue #140: "opcache.enable_file_override" doesn't respect "opcache.revalidate_freq"
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.revalidate_freq=0
7opcache.file_update_protection=0
8--SKIPIF--
9<?php require_once('skipif.inc'); ?>
10<?php if (php_sapi_name() != "cli") die("skip CLI only"); ?>
11<?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow tests excluded by request") ?>
12--FILE--
13<?php
14define("FILENAME", dirname(__FILE__) . "/issuer0140.inc.php");
15file_put_contents(FILENAME, "1\n");
16
17var_dump(is_readable(FILENAME));
18include(FILENAME);
19var_dump(filemtime(FILENAME));
20
21sleep(2);
22file_put_contents(FILENAME, "2\n");
23
24var_dump(is_readable(FILENAME));
25include(FILENAME);
26var_dump(filemtime(FILENAME));
27
28sleep(2);
29unlink(FILENAME);
30
31var_dump(is_readable(FILENAME));
32var_dump(@include(FILENAME));
33var_dump(@filemtime(FILENAME));
34?>
35--EXPECTF--
36bool(true)
371
38int(%d)
39bool(true)
402
41int(%d)
42bool(false)
43bool(false)
44bool(false)
45