bug81607.phpt 527 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Bug #81607: CE_CACHE allocation with concurrent access
  3. --EXTENSIONS--
  4. opcache
  5. pcntl
  6. --INI--
  7. opcache.enable_cli=1
  8. --FILE--
  9. <?php
  10. $pid = pcntl_fork();
  11. if ($pid == 0) {
  12. // Child: Declare class FooBar {} to allocate CE cache slot.
  13. require __DIR__ . '/bug81607.inc';
  14. } else if ($pid > 0) {
  15. pcntl_wait($status);
  16. var_dump(new FooBar);
  17. } else {
  18. echo "pcntl_fork() failed\n";
  19. }
  20. ?>
  21. --EXPECTF--
  22. Fatal error: Uncaught Error: Class "FooBar" not found in %s:%d
  23. Stack trace:
  24. #0 {main}
  25. thrown in %s on line %d