Skip to content

Commit 013514a

Browse files
Clarify the behavior of collapseWithKeys method (#10501)
1 parent 118eb19 commit 013514a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ $collapsed->all();
436436
<a name="method-collapsewithkeys"></a>
437437
#### `collapseWithKeys()` {.collection-method}
438438

439-
The `collapseWithKeys` method flattens a collection of arrays or collections into a single collection, keeping the original keys intact:
439+
The `collapseWithKeys` method flattens a collection of arrays or collections into a single collection, keeping the original keys intact. If the collection is already flat, it will return an empty collection:
440440

441441
```php
442442
$collection = collect([

0 commit comments

Comments
 (0)