note 81950 added to language.exceptions
| From: | michael dot ochs at gmx dot net | Date: | Thu, 20 Mar 2008 20:06:38 +0000 |
| Subject: | note 81950 added to language.exceptions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137241@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. (I think this is a bug!) But you can do the following:
<?php
function throwException($message = null,$code = null) {
throw new Exception($message,$code);
}
someFunction() OR throwException();
?>
----
Server IP: 217.13.201.10
Probable Submitter: 195.14.220.54
----
Manual Page -- http://www.php.net/manual/en/language.exceptions.php
Edit -- https://master.php.net/note/edit/81950
Del: integrated -- https://master.php.net/note/delete/81950/integrated
Del: useless -- https://master.php.net/note/delete/81950/useless
Del: bad code -- https://master.php.net/note/delete/81950/bad+code
Del: spam -- https://master.php.net/note/delete/81950/spam
Del: non-english -- https://master.php.net/note/delete/81950/non-english
Del: in docs -- https://master.php.net/note/delete/81950/in+docs
Del: other reasons-- https://master.php.net/note/delete/81950
Reject -- https://master.php.net/note/reject/81950
Search -- https://master.php.net/manage/user-notes.php