preload_009.phpt 548 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Preloading class using trait 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_2.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(trait_exists('T'));
  17. var_dump(class_exists('Foo'));
  18. try {
  19. new Foo();
  20. } catch (Throwable $ex) {
  21. echo $ex->getMessage() . "\n";
  22. }
  23. ?>
  24. --EXPECT--
  25. bool(true)
  26. bool(true)
  27. Undefined constant "UNDEF"