Skip to content

Commit 4523c27

Browse files
committed
Use Traversable type for getIterator()
Compatible with all PHP 7 as well as PHP 8.0 and PHP 8.1
1 parent c1e69ca commit 4523c27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Example
1818
namespace com\example;
1919

2020
record Range(int $lo, int $hi) implements \IteratorAggregate {
21-
public function getIterator() {
21+
public function getIterator(): \Traversable {
2222
for ($i= $this->lo; $i <= $this->hi; $i++) {
2323
yield $i;
2424
}

0 commit comments

Comments
 (0)