preload_004.phpt 503 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Preloading class with undefined class constant access
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.optimization_level=-1
  7. opcache.preload={PWD}/preload_undef_const.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(class_exists('Foo'));
  17. try {
  18. new Foo();
  19. } catch (Throwable $ex) {
  20. echo $ex->getMessage() . "\n";
  21. }
  22. ?>
  23. --EXPECT--
  24. bool(true)
  25. Undefined constant self::DOES_NOT_EXIST