bug70249.phpt 752 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Bug #70249 (Segmentation fault while running PHPUnit tests on phpBB 3.2-dev)
  3. --FILE--
  4. <?php
  5. class Logger {
  6. public function __construct() {
  7. register_shutdown_function(function () {
  8. // make regular flush before other shutdown functions, which allows session data collection and so on
  9. $this->flush();
  10. // make sure log entries written by shutdown functions are also flushed
  11. // ensure "flush()" is called last when there are multiple shutdown functions
  12. register_shutdown_function([$this, 'flush'], true);
  13. });
  14. }
  15. public function flush($final = false) {
  16. return 1;
  17. }
  18. }
  19. for ($i = 0; $i < 200; $i++) {
  20. $a = new Logger();
  21. }
  22. ?>
  23. okey
  24. --EXPECT--
  25. okey