Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> in_array(.., .., $strict)

I think you're aware of the third parameter but for anyone who reads this post, it disables the type coercion of the in_array call.



Spoiling a good rant with facts.


The fact that you need to specify a third, optional parameter to get sane output out of a really basic function is still pretty rant-worthy.


But beware, with strict comparison: 1 ≠ 1.0 (because int ≠ float).


But... wouldn't you expect that?

I mean, they AREN'T the same value really.


Agree, they aren't the same type to begin with.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: