Skip to content

Commit 0edbdd7

Browse files
committed
- Add new test
1 parent bfced42 commit 0edbdd7

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

ext/spl/tests/iterator_068.phpt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
--TEST--
2+
SPL: Iterator: Overloaded object and destruction
3+
--FILE--
4+
<?php
5+
6+
class Test implements Iterator {
7+
function foo() {
8+
echo __METHOD__ . "()\n";
9+
}
10+
function rewind() {}
11+
function valid() {}
12+
function current() {}
13+
function key() {}
14+
function next() {}
15+
}
16+
17+
class TestIteratorIterator extends IteratorIterator {
18+
function __destruct() {
19+
echo __METHOD__ . "()\n";
20+
$this->foo();
21+
}
22+
}
23+
24+
$obj = new TestIteratorIterator(new Test);
25+
$obj->foo();
26+
unset($obj);
27+
28+
?>
29+
===DONE===
30+
--EXPECT--
31+
Test::foo()
32+
TestIteratorIterator::__destruct()
33+
Test::foo()
34+
===DONE===

0 commit comments

Comments
 (0)