note 81960 added to language.exceptions
| From: | michael dot ochs at gmx dot net | Date: | Fri, 21 Mar 2008 11:44:17 +0000 |
| Subject: | note 81960 added to language.exceptions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137260@lists.php.net to get a copy of this message | ||
Actually it isn't possible to do:
<?php
someFunction() OR throw new Exception();
?>
This leads to a T_THROW Syntax Error. If you want to use this kind of exceptions, you can do the
following:
<?php
function throwException($message = null,$code = null) {
throw new Exception($message,$code);
}
someFunction() OR throwException();
?>
----
Server IP: 217.160.72.57
Probable Submitter: 195.14.220.54
----
Manual Page -- http://www.php.net/manual/en/language.exceptions.php
Edit -- https://master.php.net/note/edit/81960
Del: integrated -- https://master.php.net/note/delete/81960/integrated
Del: useless -- https://master.php.net/note/delete/81960/useless
Del: bad code -- https://master.php.net/note/delete/81960/bad+code
Del: spam -- https://master.php.net/note/delete/81960/spam
Del: non-english -- https://master.php.net/note/delete/81960/non-english
Del: in docs -- https://master.php.net/note/delete/81960/in+docs
Del: other reasons-- https://master.php.net/note/delete/81960
Reject -- https://master.php.net/note/reject/81960
Search -- https://master.php.net/manage/user-notes.php