1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00
Files
archived-php-src/ext/opcache/tests/bug65915.phpt
Nikita Popov 1b3b430f47 Add --repeat testing mode
This testing mode executes the test multiple times in the same
process (but in different requests). It is primarily intended to
catch tracing JIT bugs, but also catches state leaks across
requests.

Closes GH-6365.
2020-10-30 17:29:33 +01:00

33 lines
671 B
PHP

--TEST--
Bug #65915 (Inconsistent results with require return value)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_cache_only=0
--SKIPIF--
<?php
require_once('skipif.inc');
// We don't invalidate the file after the second write.
if (getenv('SKIP_REPEAT')) die("skip Not repeatable");
?>
--FILE--
<?php
$tmp = __DIR__ . "/bug65915.inc.php";
file_put_contents($tmp, '<?php return function(){ return "a";};');
$f = require $tmp;
var_dump($f());
var_dump(opcache_invalidate($tmp, true));
file_put_contents($tmp, '<?php return function(){ return "b";};');
$f = require $tmp;
var_dump($f());
@unlink($tmp);
?>
--EXPECT--
string(1) "a"
bool(true)
string(1) "b"