title: What is the cost option in password_hash?
body: <p>In the PHP manual there are many examples which use the <code>cost</code> option in <code>password_hash</code>. Here is some sample code to calculate a good value for <code>cost</code>:</p>
  
  <pre><code>&lt;?php
  /**
  * This code will benchmark your server to determine how high of a cost you can
  * afford. You want to set the highest cost that you can without slowing down
  * you server too much. 8-10 is a good baseline, and more is good if your servers
  * are fast enough. The code below aims for ≤ 50 milliseconds stretching time,
   * which is a good baseline for systems handling interactive logins.
   */
  $timeTarget = 0.05; // 50 milliseconds 
  
  $cost = 8;
  do {
   $cost++;
   $start = microtime(true);
   password_hash("test", PASSWORD_BCRYPT, ["cost" =&gt; $cost]);
   $end = microtime(true);
  } while (($end - $start) &lt; $timeTarget);
  
  echo "Appropriate Cost Found: " . $cost . "\n";
  ?&gt;
  </code></pre>
  
  <p>What does <code>cost</code> mean? What is it for?</p>