note 104791 deleted from language.exceptions by googleguy
| From: | googleguy@php.net | Date: | Tue, 15 Jan 2013 04:40:08 +0000 |
| Subject: | note 104791 deleted from language.exceptions by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193043@lists.php.net to get a copy of this message | ||
Note Submitter: contact at xpertmailer dot com
----
To continue the execution code after throw new Exception, goto operator can be used, like this:
<?php
try {
echo 'one';
throw new Exception('-error-'); a:
echo 'two';
} catch (Exception $e) {
echo $e->getMessage();
goto a;
}
//output: one-error-two
?>
But, goto operator can NOT be evaluate or get a value:
<?php
eval('goto a;'); //Fatal error: 'goto' to undefined label 'a'
$b = 'a';
goto $b; //Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING
?>