title: How to verify a password on Symfony?
body: <p>I want verify the existing password for a user (to allow them to change their password).</p>
  <p>I thought to go the following route but ran into the problem that the hashed password always shows up as a different hash.  I am using      <code>UserPasswordHasherInterface</code>.</p>
  <pre><code>$hashedOldPassword = $passwordHasher-&gt;hashPassword(
          $user,
          $data['oldPassword']
      );
  
  if ($hashedOldPassword === $user-&gt;getPassword()) {
      setNewPassword();
  }
  </code></pre>