在php中返回Integer而不是boolean

I hope you are doing great. I have a class in my project with various methods. The thing that happens is, one of the methods is supposed to return a Boolean variable. Instead. It returned the number "1" instead of false. If you could tell me where is the problem.
Thanks in advance, Cheers. Useful pieces of my code:
Class method:

public function validatePwd($pwd1, $pwd2) {
    if (strcasecmp($pwd1, $pwd2) == 0) 
    {
        return true;
    }
    else 
    {
        return false;
    }
}

The script that executes it:

$check1 = $user->validatePwd($Password, $Password1);
    echo $check1;
    if ($user->validatePwd($Password, $Password1)) 
    {

    }
    else
    {
       $errors[] = 'Error!, passwords entered are not compatible, Please'
               . ' enter passwords that match each other'; 
    }

If you do var_dump($check1) instead of echo $check1; it should show as boolean.