Skip to content

Commit b8f6edf

Browse files
Clarify behavior of pop method when the collection is empty (#10436)
1 parent cdcc447 commit b8f6edf

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
@@ -2254,7 +2254,7 @@ $plucked->all();
22542254
<a name="method-pop"></a>
22552255
#### `pop()` {.collection-method}
22562256

2257-
The `pop` method removes and returns the last item from the collection:
2257+
The `pop` method removes and returns the last item from the collection. If the collection is empty, `null` will be returned:
22582258

22592259
```php
22602260
$collection = collect([1, 2, 3, 4, 5]);

0 commit comments

Comments
 (0)