From 11eca23be1b07b35cbdce426e8ce85347eb45a03 Mon Sep 17 00:00:00 2001 From: Ahmed Alaa <92916738+AhmedAlaa4611@users.noreply.github.com> Date: Fri, 23 May 2025 00:02:23 +0300 Subject: [PATCH] Clarify behavior of pop method when the collection is empty --- collections.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collections.md b/collections.md index 8e010c260d..bd7a951f10 100644 --- a/collections.md +++ b/collections.md @@ -2254,7 +2254,7 @@ $plucked->all(); #### `pop()` {.collection-method} -The `pop` method removes and returns the last item from the collection: +The `pop` method removes and returns the last item from the collection. If the collection is empty, `null` will be returned: ```php $collection = collect([1, 2, 3, 4, 5]);