<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Checks if the given hash matches the given options</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.password-hash.html">password_hash</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.password-verify.html">password_verify</a></div> <div class="up"><a href="ref.password.html">Password Hashing Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.password-needs-rehash" class="refentry"> <div class="refnamediv"> <h1 class="refname">password_needs_rehash</h1> <p class="verinfo">(PHP 5 >= 5.5.0)</p><p class="refpurpose"><span class="refname">password_needs_rehash</span> — <span class="dc-title">Checks if the given hash matches the given options</span></p> </div> <div class="refsect1 description" id="refsect1-function.password-needs-rehash-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">boolean</span> <span class="methodname"><strong>password_needs_rehash</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$hash</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$algo</code></span> [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$options</code></span> ] )</div> <p class="para rdfs-comment"> This function checks to see if the supplied hash implements the algorithm and options provided. If not, it is assumed that the hash needs to be rehashed. </p> </div> <div class="refsect1 parameters" id="refsect1-function.password-needs-rehash-parameters"> <h3 class="title">Parameters</h3> <dl> <dt> <span class="term"><em><code class="parameter">hash</code></em></span> <dd> <p class="para"> A hash created by <span class="function"><a href="function.password-hash.html" class="function">password_hash()</a></span>. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">algo</code></em></span> <dd> <p class="para"> A <a href="password.constants.html" class="link">password algorithm constant</a> denoting the algorithm to use when hashing the password. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">options</code></em></span> <dd> <p class="para"> An associative array containing options. See the <a href="password.constants.html" class="link">password algorithm constants</a> for documentation on the supported options for each algorithm. </p> </dd> </dt> </dl> </div> <div class="refsect1 returnvalues" id="refsect1-function.password-needs-rehash-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> if the hash should be rehashed to match the given <em><code class="parameter">algo</code></em> and <em><code class="parameter">options</code></em>, or <strong><code>FALSE</code></strong> otherwise. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.password-hash.html">password_hash</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.password-verify.html">password_verify</a></div> <div class="up"><a href="ref.password.html">Password Hashing Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>