Check this out:
print_r( (int) in_array('hello',array( 0 => 0)) );
It returns 1
Since you probably will have trouble believing it, here is a codepad: http://codepad.org/XlNKbrFk
Here is the official reference:
http://php.net/manual/en/function.in-array.php
bool in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] )
Yes, it seems that is_array thinks that a random string and 0 are the same thing.
So my question is, did I find a bug? Is this behavior justified? Is that drunken logic or what? Can anyone help me? I am struggling with that part.