Skip to content

Commit 0a19df6

Browse files
Clarify the behavior of head and last helpers (#10614)
1 parent 3b2df51 commit 0a19df6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

helpers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ data_forget($data, 'products.*.price');
15021502
<a name="method-head"></a>
15031503
#### `head()` {.collection-method}
15041504

1505-
The `head` function returns the first element in the given array:
1505+
The `head` function returns the first element in the given array. If the array is empty, `false` will be returned:
15061506

15071507
```php
15081508
$array = [100, 200, 300];
@@ -1515,7 +1515,7 @@ $first = head($array);
15151515
<a name="method-last"></a>
15161516
#### `last()` {.collection-method}
15171517

1518-
The `last` function returns the last element in the given array:
1518+
The `last` function returns the last element in the given array. If the array is empty, `false` will be returned:
15191519

15201520
```php
15211521
$array = [100, 200, 300];

0 commit comments

Comments
 (0)