Hacker News new | ask | show | jobs
by gravypod 3595 days ago
And yet there is a generic in array function.
1 comments

...which is O(n). Unless the set is trivially small, better to coerce your data to key types and use array_key_exists().
I never said it was good, but it exists. Most of my PHP code utilizes kv arrays everywhere possible.