bug65915.phpt 666 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Bug #65915 (Inconsistent results with require return value)
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.file_cache_only=0
  7. --EXTENSIONS--
  8. opcache
  9. --SKIPIF--
  10. <?php
  11. // We don't invalidate the file after the second write.
  12. if (getenv('SKIP_REPEAT')) die("skip Not repeatable");
  13. ?>
  14. --FILE--
  15. <?php
  16. $tmp = __DIR__ . "/bug65915.inc.php";
  17. file_put_contents($tmp, '<?php return function(){ return "a";};');
  18. $f = require $tmp;
  19. var_dump($f());
  20. var_dump(opcache_invalidate($tmp, true));
  21. file_put_contents($tmp, '<?php return function(){ return "b";};');
  22. $f = require $tmp;
  23. var_dump($f());
  24. @unlink($tmp);
  25. ?>
  26. --EXPECT--
  27. string(1) "a"
  28. bool(true)
  29. string(1) "b"