preload_001.phpt 484 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Preloading basic test
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.optimization_level=-1
  7. opcache.preload={PWD}/preload.inc
  8. --EXTENSIONS--
  9. opcache
  10. --SKIPIF--
  11. <?php
  12. if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
  13. ?>
  14. --FILE--
  15. <?php
  16. var_dump(function_exists("f1"));
  17. var_dump(function_exists("f2"));
  18. $rt = true;
  19. include(__DIR__ . "/preload.inc");
  20. var_dump(function_exists("f2"));
  21. ?>
  22. OK
  23. --EXPECT--
  24. bool(true)
  25. bool(false)
  26. bool(true)
  27. OK