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::values()
1 parent 7e206cf commit 2994a95Copy full SHA for 2994a95
docs/Set.md
@@ -11,6 +11,7 @@ The Set object holds only unique values of any type.
11
- [`Set::entries()`](#setentries)
12
- [`Set::forEach()`](#setforeach)
13
- [`Set::has()`](#sethas)
14
+- [`Set::values()`](#setvalues)
15
- [`Set::size`](#setsize)
16
17
## Constructor
@@ -127,6 +128,23 @@ $set->has(6);
127
128
// false
129
```
130
131
+### Set::values()
132
+
133
+The `values()` method returns a new `SetIterator` instance that contain the values of each element of the Set.
134
135
+```php
136
+$set = new Set(['foo', 'bar']);
137
138
+$iterator = $set->values();
139
+// [object SetIterator]
140
141
+$iterator->current();
142
+// 'foo'
143
144
+$iterator->next();
145
+// 'bar'
146
+```
147
148
## Properties
149
150
### Set::size
0 commit comments