Uh oh!
There was an error while loading. Please reload this page.
Promote the warning of array_key_exists() to exception - #4887
Conversation
nikic
commented
Nov 4, 2019
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 |
nikic
commented
Nov 4, 2019
@kocsismate Chaning |
nikic
commented
Nov 4, 2019
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
04d25cdCompareUh oh!
There was an error while loading. Please reload this page.
kocsismate
left a comment
There was a problem hiding this comment.
@nikic I tried my best to do what you suggested.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
04d25cd to
7e3a206CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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).