-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Promote the warning of array_key_exists() to exception #4887
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
Conversation
See #4572. |
Yes, I should have remembered about this PR (or at least checked for it). :D OK, not doing warning promotions certainly makes sense for |
@kocsismate Chaning |
That is, the argument should not be "string or integer", it should work based on the normal array key coercions that are used everywhere else where array accesses are performed. Only arrays and objects should result in a TypeError. |
d065f42
to
04d25cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikic I tried my best to do what you suggested.
04d25cd
to
7e3a206
Compare
I am not exactly sure if these promotions fall into the scope of the Engine Warnings RFC (are these errors suppressed commonly?), so feel free to close the PR in this case.
Also, I made two more promotions in the standard/array.c file, but these doesn't seem likely to happen (one of them is in an apparently not used macro and the other should never happen according to its comment).