title: PHP: Code checker since PHP is a loose type / dynamic language?
body: <p>I have a small PHP web-based application that is beginning to grow moderately in size.</p>
  
  <p>I'm starting to become concerned with managing my PHP code base, given <strong>PHP</strong> is a <strong>loosely/weak typed, dynamic language</strong>.</p>
  
  <p>How do others manage their code based for loosely/weak typed, dynamic languages?</p>
  
  <p>Do pre-parsers exist for PHP that allow me to runs checks on my code base to identity such things like below?</p>
  
  <pre><code>$var1 = 'data';
  // vr1 doesn't exist, it's a typo of $var1, but PHP would allow for this and not complain
  echo $vr1;
  </code></pre>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>The example above might not be the best example but essentially, what I'm trying to convey is that certain errors in a dynamically weak typed language would only be found when the code is run in production at RUN TIME; whereas, some of these issues would typically be found in strongly typed static languages at COMPILE time.</p>
  
  <p>How can I also find these non-algorithm type of errors in PHP prior to moving my code into production without having to create an insane number of Unit Tests?</p>
  
  <p>As such, does anything exist where I can run my PHP code through it, prior to moving into production, and this pre-processor parses my code to ensure I'm only using defined variables, etc.  Essentially, check my code for validation for non-algorithmic type of uses. E.g. not trying perform algebra on a string, etc.</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>Please note, this question is still <strong>not answered</strong> because I'm looking for a way to identity these type of non-algorithmic errors in PHP at "compile" type, not RUN TIME.</p>