src/login_password.php
public function is_valid($password, $check_rehash=true) {
	if (password_verify($password, $this->data['hash']) == false) {
		return false;
	}
	
	if ($check_rehash && password_needs_rehash($this->data['hash'], PASSWORD_DEFAULT)) {
		$new_hash = self::hash_password($password);
		$this->set_new_hash($this->data['user_id'], $this->data['email_address'], $new_hash);
	}
	
	return true;
}
public function is_valid($password, $check_rehash=true) {
	if (password_verify($password, $this->data['hash']) == false) {
		return false;
	}
	
	if ($check_rehash && password_needs_rehash($this->data['hash'], PASSWORD_DEFAULT)) {
		$new_hash = self::hash_password($password);
		$this->set_new_hash($this->data['user_id'], $this->data['email_address'], $new_hash);
	}
	
	return true;
}
public function is_valid ( $ password , $ check_rehash = true ) { if ( password_verify ( $ password , $ this -> data [ 'hash' ] ) == false ) { return false ; } if ( $ check_rehash && password_needs_rehash ( $ this -> data [ 'hash' ] , PASSWORD_DEFAULT ) ) { $ new_hash = self :: hash_password ( $ password ) ; $ this -> set_new_hash ( $ this -> data [ 'user_id' ] , $ this -> data [ 'email_address' ] , $ new_hash ) ; } return true ; }
check if the password gives access to the login
also re-hashes the password hash if the algorithm is out of date

@param  string  $password     in plain text
@param  boolean $check_rehash set to false to skip re-hashing
@return boolean
check if the password gives access to the login also re - hashes the password hash if the algorithm is out of date