php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60184 Exception stack frame text is misleading/incorrect
Submitted: 2011-11-01 04:04 UTC Modified: 2016-06-15 13:45 UTC
Votes:5
Avg. Score:3.2 ± 1.8
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:2 (40.0%)
From: ss23 at ss23 dot geek dot nz Assigned:
Status: Duplicate Package: *General Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2011-11-01 04:04 UTC] ss23 at ss23 dot geek dot nz
Description:
------------
The exception stack frame is created on line 2, however, it's thrown on line 3.
Perhaps this text should be changed to "instantiated ... on line 2" instead.

As a related issue, if you had an exception factory, this would cause issues to no 
end in that you cannot see the line number when the exception really was thrown, 
you would only see the stack from inside the factory.

Test script:
---------------
<?php
$e = new Exception();
throw $e;
?>

Expected result:
----------------
Fatal error: Uncaught exception 'Exception' in /code/PRdMIg:2 Stack trace: #0 
{main} thrown in /code/PRdMIg on line 3

OR

Fatal error: Uncaught exception 'Exception' in /code/PRdMIg:2 Stack trace: #0 
{main} instantiated in /code/PRdMIg on line 2

Actual result:
--------------
Fatal error: Uncaught exception 'Exception' in /code/PRdMIg:2 Stack trace: #0 
{main} thrown in /code/PRdMIg on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-06 07:33 UTC] mike@php.net
-Status: Open +Status: Verified
 [2016-06-15 13:45 UTC] nikic@php.net
-Status: Verified +Status: Duplicate
 [2016-06-15 13:45 UTC] nikic@php.net
Marking as a duplicate of bug the newer #64910 which has a bit more discussion.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 22:01:29 2024 UTC