Skip to content

Conversation

@zigzagdev
Copy link

Propose

  • Fix result validation

why

This change replaces a simple negation check with empty() to ensure empty arrays
are also treated as failure in result validation logic. Because I felt that using a simple ! condition makes it ambiguous as to what values are actually being evaluated as falsy.

@LordSimal
Copy link
Contributor

LordSimal commented Jul 26, 2025

We purposely don't use empty() that often because it can cause weird side effects.
See https://dev.to/klnjmm/never-use-empty-function-in-php-4pb0 for example

As you can see in https://3v4l.org/A1TGS#vnull an empty array is still falsey, so empty arrays are already rejected by default.

Your bug seems to be related to something different.

@zigzagdev zigzagdev closed this Jul 27, 2025
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