xref: /PHP-7.3/ext/opcache/tests/bug65915.phpt (revision 9ff08ae1)
1--TEST--
2Bug #65915 (Inconsistent results with require return value)
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_cache_only=0
7--SKIPIF--
8<?php require_once('skipif.inc'); ?>
9--FILE--
10<?php
11$tmp = __DIR__ . "/bug65915.inc.php";
12
13file_put_contents($tmp, '<?php return function(){ return "a";};');
14$f = require $tmp;
15var_dump($f());
16
17var_dump(opcache_invalidate($tmp, true));
18
19file_put_contents($tmp, '<?php return function(){ return "b";};');
20$f = require $tmp;
21var_dump($f());
22
23@unlink($tmp);
24?>
25--EXPECT--
26string(1) "a"
27bool(true)
28string(1) "b"
29