title: Force PHP to echo when loop finishes
body: <p>I'm testing PHP5.5's new <code>password_hash</code> technique and, for debug purposes, am wanting to have PHP echo each time my <code>for</code> loop finishes, instead of waiting for the page to finish loading (or for apache to cut it). I am using wamp server for my debugging, and have enabled <code>implicit_flush</code>, and disabled <code>output_buffering</code>.</p>
  
  <p>My code is:</p>
  
  <pre><code>&lt;?php
      ob_start();
      $wordtohash = "rasmuslerdorf";
  
      //require ircmaxell's PHP5 backward compat lib (https://github.com/ircmaxell/password_compat)
      require 'lib/pw.php';
  
      echo "Beginning hashing: &lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;";
  
      ob_flush();
  
      $options = [
          'cost' =&gt; 15
      ];
  
      for ($i=0; $i &lt; 10; $i++) {
          if (isset($hashed)) {
              $wordtohash = $hashed;
          }
  
          //start counting
          $mtime = microtime();
          $mtime = explode(" ", $mtime);
          $mtime = $mtime[1] + $mtime[0];
          $start = $mtime;
  
          //hash
          $hashed = "Attempt {$i}: ".password_hash($wordtohash, PASSWORD_BCRYPT, $options);
  
          //end counting
          $mtime = microtime();
          $mtime = explode(" ",$mtime);
          $mtime = $mtime[1] + $mtime[0];
          $end = $mtime;
          $totaltime = ($end - $start);
          echo $hashed." (total time: ".$totaltime." seconds)&lt;br /&gt;&lt;br /&gt;";
  
          ob_flush();
      }
  ?&gt;
  </code></pre>
  
  <p>What this is doing is hashing a test word, "rasmuslerdorf", and collecting the hash and then sending that back in to be hashed (for as many times as the loop specifies).</p>
  
  <p>I have a timer set up for each, but would like to have each show up on the page as they finish for testing.</p>
  
  <p>I have tried using <code>ob_start()</code> followed by <code>ob_flush()</code> commands where needed, but that didn't work (<code>implicit_flush</code> is supposed to make it flush on <code>echo</code> or <code>print</code>, so I'm at a loss) and I have also tried <code>flush()</code>.</p>
  
  <p>Does anyone happen to have any extra ideas? Much appreciated.</p>