mirror of
https://github.com/php/php-src.git
synced 2024-12-16 05:15:03 +08:00
25 lines
439 B
PHP
25 lines
439 B
PHP
--TEST--
|
|
GC 046: Leak in User Iterator
|
|
--INI--
|
|
zend.enable_gc=1
|
|
--FILE--
|
|
<?php
|
|
class Action {
|
|
private $iterator;
|
|
function __construct() {
|
|
$this->iterator = new ArrayIterator($this);
|
|
}
|
|
function filter() {
|
|
$this->iterator = new CallbackFilterIterator($this->iterator, fn() => true);
|
|
$this->iterator->rewind();
|
|
}
|
|
}
|
|
|
|
$action=new Action;
|
|
$action->filter();
|
|
$action->filter();
|
|
?>
|
|
DONE
|
|
--EXPECT--
|
|
DONE
|