preload_012.phpt 502 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. No autoloading during constant resolution
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.optimization_level=-1
  7. opcache.preload={PWD}/preload_const_autoload.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. class Foo {
  17. }
  18. var_dump(class_exists('Test'));
  19. try {
  20. new Test();
  21. } catch (Throwable $ex) {
  22. echo $ex->getMessage() . "\n";
  23. }
  24. ?>
  25. --EXPECT--
  26. bool(true)
  27. Undefined constant Foo::BAR