I have a method return type can either be an array of things or false.
I am therefore casting the result to an array to try to ensure my code doesnt need to check for false or array.
But, php is casting false to an array containing 1 element: false:
array(1) {
[0]=>
bool(false)
}
WHY!
Is there a way to achieve this without the if statement?
i.e.
if ($returnValue === false) {
return array();
} else {
return $returnValue;
}