gc_046.phpt 416 B

1234567891011121314151617181920212223
  1. --TEST--
  2. GC 046: Leak in User Iterator
  3. --INI--
  4. zend.enable_gc=1
  5. --FILE--
  6. <?php
  7. class Action {
  8. function __construct() {
  9. $this->iterator = new ArrayIterator($this);
  10. }
  11. function filter() {
  12. $this->iterator = new CallbackFilterIterator($this->iterator, fn() => true);
  13. $this->iterator->rewind();
  14. }
  15. }
  16. $action=new Action;
  17. $action->filter();
  18. $action->filter();
  19. ?>
  20. DONE
  21. --EXPECT--
  22. DONE