Re: Bug #64910: Line number of $e = new Exception vs. line number of throw $e
| From: | Stas Malyshev | Date: | Thu, 23 May 2013 20:22:32 +0000 |
| Subject: | Re: Bug #64910: Line number of $e = new Exception vs. line number of throw $e | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67463@lists.php.net to get a copy of this message | ||
Hi!
> Derick agrees with me that this is a bug. We propose to update the file
> and line properties of the exception object in the
> zend_throw_exception_internal() and zend_throw_exception() functions.
>
> Would such a change be accepted? Does it require an RFC?
On one hand, I think it makes sense - nobody really cares where the
exception was created... But there's one problem here:
try {
//stuff
} catch(Exception $e) {
$logger->log("Oops, exception!");
throw $e;
}
If we update file/line here, we lose original exception information and
file/line in the exception becomes useless. Right now, since 99.99% of
the code does "throw new", it is always useful. So how you would propose
to solve this?
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227