note 124312 added to language.exceptions
| From: | shaman_master.list.ru via php-notes | Date: | Sun, 20 Oct 2019 12:07:54 +0000 |
| Subject: | note 124312 added to language.exceptions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-212735@lists.php.net to get a copy of this message | ||
Example for PHP 7.0 or latest:
<?php
namespace SomeNamespace;
use Throwable, Exception, Error;
class SomeClass
{
public function someMethod()
{
try {
if (rand(0, 1)) {
throw new Exception('Some message');
} else {
throw new Error('Some message');
}
} catch (Throwable $e) {
\var_dump($e->getMessage());
}
}
public function __toString()
{
try {
return (string) $this->someMethod();
} finally {
return '';
}
}
}
?>
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.168 (proxied: 31.129.195.213)
----
Manual Page -- http://php.net/manual/en/language.exceptions.php
Edit -- https://master.php.net/note/edit/124312
Del: integrated -- https://master.php.net/note/delete/124312/integrated
Del: useless -- https://master.php.net/note/delete/124312/useless
Del: bad code -- https://master.php.net/note/delete/124312/bad+code
Del: spam -- https://master.php.net/note/delete/124312/spam
Del: non-english -- https://master.php.net/note/delete/124312/non-english
Del: in docs -- https://master.php.net/note/delete/124312/in+docs
Del: other reasons-- https://master.php.net/note/delete/124312
Reject -- https://master.php.net/note/reject/124312
Search -- https://master.php.net/manage/user-notes.php