Skip to content

Conversation

mohammadMghi
Copy link

@mohammadMghi mohammadMghi commented Oct 3, 2025

Laravel Version

12.x

PHP Version

8.2.28

Description

This PR fixes an issue where calling where on a collection returns null instead of 0. #54910

Problem

When we write an array that contains 0, it goes into EnumeratesValues inside collections. There, it interprets 0 as false and compares it with $value. For normal numbers, it works correctly because numbers greater than 0 are interpreted as true, and when compared, the callback function works as expected.

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants