title: PHP - Bcrypt hash comparison always fails
body: <pre><code>&lt;?php
  
  require 'password.php';
  $hash1 = password_hash('testpassword',PASSWORD_BCRYPT,array('cost' =&gt; 11));
  $hash2 = password_hash('testpassword',PASSWORD_BCRYPT,array('cost' =&gt; 11));
  
  if(password_verify($hash1,$hash2)) echo 'Pass';
  else echo 'Fail';
  
  ?&gt;
  </code></pre>
  
  <p>I'm trying to use bcrypt provided by the password_compat library with PHP 5.4.16, but this script always outputs "Fail" even though it's comparing two hashes of the same password, why?</p>
  
  <p>Edit - Just for clarification, I realize the hashes aren't identical, otherwise I'd just compare them instead of using a function.</p>