Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 7.0 - Update Query - setValues() - empty string value filtered out #92

Open
evanirla opened this issue Dec 30, 2017 · 3 comments
Open

Comments

@evanirla
Copy link

When calling the setValues function, if the array contains a key/value pair with an empty string value, the key/value pair will be filtered out.

Looking at the code, there is an issue with the array_filter call where an empty string value is treated as false.

@evanirla
Copy link
Author

I just did a test, using the isset() function seems to work.

@marcus-hiles
Copy link

great @evanirla , but yes PHP does sees empty string as false when its used in a conditional statement, so will be good to avoid passing empty strings

@Silic0nS0ldier
Copy link

Just hit this issue myself on 1.8.0. While PHP treats an empty string as false, in this context the outcome does not represent the intended behaviour and blocks a number of valid (and common) use cases. null, "", false, and any other falsey values should valid input for a field.

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

No branches or pull requests

3 participants