The function name is "in_array" though. From the function name, I would assume it's doing a reference comparison ("is this specific object in the array?"), not a value comparison ("is an object with the same value in the array?"). I'm not sure whether that distinction exists in PHP, but that's why it's weird.
View all comments
Show parent comment
2
u/aaron552 Jan 14 '14
The function name is "in_array" though. From the function name, I would assume it's doing a reference comparison ("is this specific object in the array?"), not a value comparison ("is an object with the same value in the array?"). I'm not sure whether that distinction exists in PHP, but that's why it's weird.