Re: note 17187 added to function.die
| From: | Zak Greant | Date: | Thu, 29 Nov 2001 04:48:09 +0000 |
| Subject: | Re: note 17187 added to function.die | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-21406@lists.php.net to get a copy of this message | ||
On November 28, 2001 08:59 pm, jdv@clevermonkey.org wrote:
> <p>It looks like die() kills every PHP "script" in a page. I have a main
> page with four distinct <script language="php> ... </script>
> sections.</p><p>If the second one dies (if, for example, I need to bail out
> of the script due to a missing file), the remaining two will never be
> executed.</p><p>I'm running the scripts embedded inside .html files.</p>
A <script ...>...</script> block is not a separate PHP script. Instead,
these tags let the parser know when to look for PHP code to execute.
For cases like this, where you wish to handle errors in one block of
code but still run subsequent blocks, use flow control constructs like
if or switch.
--
Zak Greant
PHP Quality Assurance Team
http://qa.php.net/
"We must be the change we wish to see." - M. K. Ghandi