title: str_replace with strpos?
body: <p>The <strong>str_replace</strong> function with a <strong>strpos</strong> checking can avoid extra work?</p>
  
  <p><strong>METHOD 1</strong></p>
  
  <pre><code>...
  if (strpos($text, $tofind) !== FALSE)
   $text = str_replace($tofind, $newreplace, $text);
  ...
  </code></pre>
  
  <p><strong>METHOD 2</strong></p>
  
  <pre><code>...
  $text = str_replace($tofind, $newreplace, $text);
  ...
  </code></pre>
  
  <p>Question: This two methods works but... I want know if strpos-checking (or other) is good way or a bad, useless (and optimization antipattern).</p>