Приглашаем посетить
Ахматова (ahmatova.niv.ru)

Section 3.4.  Abnormal Script Termination

Previous
Table of Contents
Next

3.4. Abnormal Script Termination

Most scripts will execute from start to finish, but sometimes they might end prematurely. There is a variety of reasons why this will happen:

  1. You've screwed up somewhere, and PHP cannot execute your code.

  2. PHP has screwed up somewhere due to a bug and cannot continue.

  3. Your script has taken too long to execute and gets killed by PHP.

  4. Your script has requested more memory than PHP can allocate and gets killed by PHP.

To be brutally honest, the first situation is unequivocally the most common. This will change a little as your skill with PHP improves, but the first situation is still the most common, even among the most veteran programmers.

Common errors include missing semicolons and parentheses, for example:

    <?php
            $i = 10
            $j = 5;
            if (($i + 2) - ($j + 5) == 10 {
                    print "Success!";
            }
    ?>

The first line is missing a semicolon, which will cause PHP to flag an error on the second line. Also, the second line is missing a parenthesis after "== 10", causing another error.


Previous
Table of Contents
Next