title: BCRYPT password changing after including with 'require' PHP
body: <p>I'm having an issue where a temporary stored password changes whenever the file it is stored in is included using <code>require</code> in PHP.</p>
  
  <p>I'm building a CMS and am storing a password temporarily in a separate file (<code>temp_register.php</code>).</p>
  
  <pre><code>/* Some more PHP above */ 
  
  require 'lib/password.php';
  
  $pass1 = password_hash($pass1, PASSWORD_BCRYPT);
  
  /* Script to store password in file below this line */
  </code></pre>
  
  <p>But whenever I want to <code>require</code> the file in another PHP script the password hash changes.</p>
  
  <pre><code>/* Some more PHP above */
  
  require 'temp/temp_register.php';
  
  /* Password is stored as $pass in that file
  This line of JavaScript is for test purpose only! */
  ?&gt;&lt;script&gt;alert('&lt;?php echo $pass; ?&gt;');&lt;/script&gt;&lt;?php
  
  $query = "INSERT INTO users VALUES ('',:username,:email,:password)";
  $stmt = $db-&gt;prepare($query);
  $stmt-&gt;bindParam(':username', $username);
  $stmt-&gt;bindParam(':email', $email);
  $stmt-&gt;bindParam(':password', $pass);
  $stmt-&gt;execute();
  
  /* Some more PHP below */
  </code></pre>
  
  <p>I used an JavaScript alert to check if the password indeed changed, and it did.</p>