This is weird
var_dump(filter_var(true, FILTER_VALIDATE_BOOLEAN));
var_dump(filter_var(false, FILTER_VALIDATE_BOOLEAN));
bool(true)
bool(false)
What an I missing here? Surely they should both be true? If not how can I validate a false boolean?
Edit: To clarify. I need to validate a false boolean. To ensure it's not a string, int, float or anything else. e.g.
$var = false; //true
$var = true; //true
$var = 'foo'; //false
$var = 1; //false
Perhaps I asked my question incorrectly or I've evolved it too much ad I should ask another question.
Solution I went for was:
$result = filter_var($bool, FILTER_VALIDATE_BOOLEAN) && ($bool===true||$bool===false);