note 124019 added to language.exceptions
| From: | DavidSpector@php.net | Date: | Sat, 06 Jul 2019 12:40:34 +0000 |
| Subject: | note 124019 added to language.exceptions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-211483@lists.php.net to get a copy of this message | ||
This page states, "Code may be surrounded in a try block, to facilitate the catching of
potential exceptions." There are two ways in which code may be "surrounded". The
obvious (intuitive) way is lexical enclosure: all the code to be protected by the try block is
surrounded like this:
try
{
A();
function A()
{
throw new Exception('error');
echo "A()";
} // A
} // try
catch...
The other way to enclose is by execution (dynamic enclosure), like this:
try
{
A();
} // try
catch...
function A()
{
throw new Exception('error');
echo "A()";
} // A
The sense in which code is "surrounded" for exception handling is dynamic (the second
example above). This is because exception handling is dynamic and works by "unwinding" the
execution stack.
----
Server IP: 208.43.231.9
Probable Submitter: 82.199.157.34 (proxied: 98.2.238.89)
----
Manual Page -- http://php.net/manual/en/language.exceptions.php
Edit -- https://master.php.net/note/edit/124019
Del: integrated -- https://master.php.net/note/delete/124019/integrated
Del: useless -- https://master.php.net/note/delete/124019/useless
Del: bad code -- https://master.php.net/note/delete/124019/bad+code
Del: spam -- https://master.php.net/note/delete/124019/spam
Del: non-english -- https://master.php.net/note/delete/124019/non-english
Del: in docs -- https://master.php.net/note/delete/124019/in+docs
Del: other reasons-- https://master.php.net/note/delete/124019
Reject -- https://master.php.net/note/reject/124019
Search -- https://master.php.net/manage/user-notes.php