Skip to content

fix collection first() and null-key existence handling#287

Merged
techmahedy merged 1 commit into
doppar:3.xfrom
techmahedy:techmahedy-3.x
Jun 12, 2026
Merged

fix collection first() and null-key existence handling#287
techmahedy merged 1 commit into
doppar:3.xfrom
techmahedy:techmahedy-3.x

Conversation

@techmahedy

Copy link
Copy Markdown
Member

Description

This PR fixes two issues in Phaseolies\Support\Collection and adds unit coverage to prevent regressions.

What changed

  • Fixed Collection::first() so it returns the first actual item in the collection, even when the collection uses associative keys.
  • Fixed Collection::__isset() and Collection::offsetExists() to use array_key_exists() instead of isset(), so keys with null values are still treated as present.

@techmahedy techmahedy added the bug Something isn't working label Jun 12, 2026
@techmahedy techmahedy merged commit 65c84c5 into doppar:3.x Jun 12, 2026
43 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant