On Fri, May 24, 2013 at 10:44 AM, Stas Malyshev <smalys...@sugarcrm.com>wrote:

> Hi!
>
> > As a PHP programmer, I would always expect the file/line to refer to
> > the throw statement that has thrown it last. If I wanted to keep track
>
> It is rather surprising that you would expect that as a PHP programmer,
> since it never worked this way in PHP, and no PHP code works this way
> either.
>
> Also, throwing new exception with previous is not the same as throwing
> the same exception twice.


I agree, I think it makes sense to see exceptions as immutable and let
"new" define the line.

If you want to rethrow an exception in a different context while keeping
track of both, I think chaining them is the better approach: throw new
AnotherException("..", 0, $thepreviousexception);



> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Etienne Kneuss
http://www.colder.ch

Reply via email to