Skip to content

Conversation

@inxilpro
Copy link
Contributor

@inxilpro inxilpro commented Feb 9, 2022

This fixes #40877 but is technically a breaking change. Generally, I think this leads to more expected behavior, but it could be an issue for someone who currently expects that returning a falsy value will result in the conditionable object to be returned.

A more backwards-compatible approach might be to do an is_null($result) || $result === false check instead. I personally think the null coalesce is fine, but I just wanted to point it out.

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.

[9.x] Conditionable::when returns Collection when callback or default return empty value (e.g. 0)

3 participants