We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Set::forEach()
1 parent 6c17e84 commit fe5e145Copy full SHA for fe5e145
docs/Set.md
@@ -9,6 +9,7 @@ The Set object holds only unique values of any type.
9
- [`Set::clear()`](#setclear)
10
- [`Set::delete()`](#setdelete)
11
- [`Set::entries()`](#setentries)
12
+- [`Set::forEach()`](#setforeach)
13
- [`Set::has()`](#sethas)
14
- [`Set::size`](#setsize)
15
@@ -100,6 +101,18 @@ $iterator->current();
100
101
// ['foo', ''foo']
102
```
103
104
+### Set::forEach()
105
+
106
+The `forEach()` method executes a provided function once per each element of the Set.
107
108
+```php
109
+$set = new Set([3, 0]);
110
111
+$set->forEach(function (int $value1, int $value2, Set $set) {
112
+ // ...
113
+});
114
+```
115
116
### Set::has()
117
118
The `has()` method returns `TRUE` when element with the specified value exists in the `Set` or `FALSE` if it does not exist.
0 commit comments