-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: dot_array_search()
unexpected behavior
#5940
Conversation
I think I would prefer an exception to be thrown ("Array key does not exist." or so). I think there is two cases where the statement can be reached:
|
Yes. But this returns null. Do you want to change to throw an exception? CodeIgniter4/tests/system/Helpers/ArrayHelperTest.php Lines 99 to 108 in aee95af
|
@sfadschm What if, instead of an exception, add a third argument to the function, which will contain a default value for the case when the key is not found? |
Oh, right. I missed that we already use @iRedds: Sounds like a nice addition, but might be out of scope for this PR. I also think changing the signature would be another BC break and while |
Definitely needs a changelog and/or user guide entry though ☺ |
7f5ca5f
to
4c3f857
Compare
Added the documentation. |
4c3f857
to
be1610b
Compare
Rebased. |
Description
Fixes #5939
Checklist: