Welcome Guest, Not a member yet? Register   Sign In
Array helper bug
#1

[eluser]Unknown[/eluser]
I've found that Array_Helper class can possibly have one bug, I'm specifically talking about element() method. This is the current if instruction:

Code:
if ( ! isset($array[$item]) OR $array[$item] == "")
{
return $default;
}

If an array element will contain 0, or null, the function will evaluate to FALSE instead of returning the value. As far as I can understand this behavior for null, I don't really know why this function returns false for 0 also.

If I'm wrong, just delete this thread, thanks Tongue
#2

[eluser]Aken[/eluser]
It's best to report potential bugs on the CI Github page rather than here. Also, make sure to check the current source code to see if the problem has been addressed already.

You are correct, though, and it has been fixed for the next version.




Theme © iAndrew 2016 - Forum software by © MyBB