title: PHP Datatype mismatch on comparison
body: <p>So I have 2 variables, <code>var1,</code> <code>var2</code>. </p>
  
  <pre><code>$var1 = "53,000,000" //- integer
  $var2 = 10 //- string
  </code></pre>
  
  <p>In the end I want to compare both, so I</p>
  
  <pre><code>$var1 = (int)str_replace(",","",$var1); // =&gt; 53000000 - integer
  </code></pre>
  
  <p>Here's my issue .. if I do:  </p>
  
  <pre><code>if($var1 &gt; $var2)  
      $var2 = $var1
  </code></pre>
  
  <p>I get <code>$var2 = 0</code> .... Why ?<br>
  .. running on PHP 5.2.14</p>
  
  <p><b>EDIT</b> Accidentally typed in substr_replace instead of str_replace. Updated.</p>