I'm making a program that will only accept a boolean value as parameter. I thought I could instanceof
to do this, but it does not work as I expected.
function test (boolean $param) {
echo $param;
}
test(true);
When I use it in my program, I get following error message:
Argument 1 passed to test() must be an instance of boolean
Is instanceof
the right method to do this and how does it work?