Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP: Code checker since PHP is a loose type / dynamic language?
    primarykey
    data
    text
    <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>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload