File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ primitive values) may be used as either a key or a value.
10
10
- [ ` Map::delete() ` ] ( #mapdelete )
11
11
- [ ` Map::get() ` ] ( #mapget )
12
12
- [ ` Map::has() ` ] ( #maphas )
13
+ - [ ` Map::keys() ` ] ( #mapkeys )
13
14
- [ ` Map::set() ` ] ( #mapset )
14
15
- [ ` Map::size ` ] ( #mapsize )
15
16
@@ -98,6 +99,20 @@ $myMap->has('baz');
98
99
// false
99
100
```
100
101
102
+ ### Map::keys()
103
+
104
+ The ` keys() ` method returns a new ` MapIterator ` instance that contain the keys of each element of the Map.
105
+
106
+ ``` php
107
+ $myMap = new Map(['foo' => 'bar']);
108
+
109
+ $iterator = $myMap->keys();
110
+ // [object MapIterator]
111
+
112
+ $iterator->current();
113
+ // 'foo'
114
+ ```
115
+
101
116
### Map::set()
102
117
103
118
The ` set() ` method adds or updates an element in map with a specified key and a value.
You can’t perform that action at this time.
0 commit comments