Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is a common complaint with PHP. Here are some ideas:</p> <ol> <li><p>Use a <a href="https://stackoverflow.com/questions/378959/is-there-a-static-code-analyzer-like-lint-for-php-files">code analysis tool</a>. Many IDEs such as <a href="http://netbeans.org/" rel="nofollow noreferrer">Netbeans</a> will help also.</p></li> <li><p><em>Just run the code.</em> PHP doesn't have an expensive compilation step like C++ does.</p></li> <li><p>Use unit testing. Common side effects include: better code.</p></li> <li><p>Set <a href="http://us2.php.net/manual/en/function.error-reporting.php" rel="nofollow noreferrer"><code>error_reporting(-1)</code></a>, or the equivalent in your <a href="http://us2.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting" rel="nofollow noreferrer">ini file</a>.</p></li> <li><p>Get <a href="http://xdebug.org/" rel="nofollow noreferrer">xdebug</a>. It's not preventative, but stack traces help with squishing bugs.</p></li> <li><p><a href="http://us2.php.net/manual/en/function.isset.php" rel="nofollow noreferrer"><code>isset()</code></a>, <a href="http://php.net/manual/en/language.operators.comparison.php" rel="nofollow noreferrer"><code>=== null</code></a> (identity operator), and guard clauses are your friends.</p></li> </ol> <p>Loose and dynamic typing are a feature of the language. Just because PHP <a href="http://www.php.net/manual/en/types.comparisons.php" rel="nofollow noreferrer">isn't strict about typing</a> doesn't mean you can't be. If it really bugs you and you have a choice, you could try Python instead&mdash;it's a bit stricter with typing.</p>
    singulars
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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