note 116330 added to language.exceptions.extending
| From: | shaman_master at list dot ru | Date: | Sun, 14 Dec 2014 00:57:09 +0000 |
| Subject: | note 116330 added to language.exceptions.extending | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201143@lists.php.net to get a copy of this message | ||
Use this example for not numeric codes:
<code>
<?php
class MyException extends Exception
{
/**
* Creates a new exception.
*
* @param string $message Error message
* @param mixed $code The exception code
* @param Exception $previous Previous exception
* @return void
*/
public function __construct($message = '', $code = 0, Exception $previous = null)
{
// Pass the message and integer code to the parent
parent::__construct((string)$message, (int)$code, $previous);
// @link http://bugs.php.net/39615 Save the
unmodified code
$this->code = $code;
}
}
</code>
----
Server IP: 72.52.91.14
Probable Submitter: 31.129.195.152
----
Manual Page -- http://php.net/manual/en/language.exceptions.extending.php
Edit -- https://master.php.net/note/edit/116330
Del: integrated -- https://master.php.net/note/delete/116330/integrated
Del: useless -- https://master.php.net/note/delete/116330/useless
Del: bad code -- https://master.php.net/note/delete/116330/bad+code
Del: spam -- https://master.php.net/note/delete/116330/spam
Del: non-english -- https://master.php.net/note/delete/116330/non-english
Del: in docs -- https://master.php.net/note/delete/116330/in+docs
Del: other reasons-- https://master.php.net/note/delete/116330
Reject -- https://master.php.net/note/reject/116330
Search -- https://master.php.net/manage/user-notes.php