The issue is when working with large arrays or being called frequently, array_key_exists is 2x to 10x slower than isset.
Already fixed in 7.4
Interesting! Might need to give 7.4 a look sooner than expected.
Interesting, thanks! Do you have a benchmark available somewhere?
It's a simple benchmark with many examples, but to quote one of them provided on the PHP manual:
Benchmark (100000 runs): array_key_exists() : 205 ms is_set() : 35ms isset() || array_key_exists() : 48ms
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The issue is when working with large arrays or being called frequently, array_key_exists is 2x to 10x slower than isset.
Already fixed in 7.4
Interesting! Might need to give 7.4 a look sooner than expected.
Interesting, thanks! Do you have a benchmark available somewhere?
It's a simple benchmark with many examples, but to quote one of them provided on the PHP manual: