original_string: 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;
  }
code: 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;
  }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: check if the password gives access to the login also re - hashes the password hash if the algorithm is out of date