I have this function
//$hasher is a phpass object.
public function getHash( $check )
{
global $hasher;
if ( $check == 'hash' )
{
return $hasher->HashPassword($this->password);
}
else if ( $check == 'check' )
{
return $hasher->CheckPassword($this->password, $this->getData('data')['password']);
}
else
{
return 'F*** off';
}
}
When i call it this is what i get
$obj->getHash('hash')
//getHash(): $2a$08$Uof.EzLkJI..........
$obj->getHash('check')
//getHash(): 1
$obj->getHash('dsadaldas') //and anything else in the brackets
//getHash():F*** off
$obj->getHash(TRUE)
//getHash(): $2a$08$3vNYnGVsf...
Why does calling the method with TRUE
return the same as if i had called it with 'hash'
as an argument? Am i missing something here? I tried it with switch()
and it still behaves the same.