invocable-class.phpt 419 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Reference to invocable class retained while running
  3. --FILE--
  4. <?php
  5. class Test {
  6. public function __invoke() {
  7. $GLOBALS['test'] = null;
  8. var_dump($this);
  9. try {
  10. Fiber::suspend();
  11. } finally {
  12. var_dump($this);
  13. }
  14. }
  15. }
  16. $test = new Test;
  17. $fiber = new Fiber($test);
  18. $fiber->start();
  19. ?>
  20. --EXPECTF--
  21. object(Test)#%d (0) {
  22. }
  23. object(Test)#%d (0) {
  24. }