Replies: 1 comment
-
As far as I am aware, an empty string is a perfectly valid array key from a PHP standpoint. It probably doesn't have a lot of useful use cases ( I can't think of any), but it's still valid. If the_framework_ has a valid reason for excluding empty strings as keys for appended attributes, then it should probably be documented somewhere. For the most part though, it should be up to your application to decide if that's a valid key for your model. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
10.38.2
PHP Version
8.1.4
Database Driver & Version
No response
Description
laravel dont throw an exception when empty string was appended as below:
this query would return an empty key with a null value:
Steps To Reproduce
return User::first()->append(['']);
Beta Was this translation helpful? Give feedback.
All reactions