Error line reported incorrectly iif error handler throws an exception
| Bug #51394 | Error line reported incorrectly iif error handler throws an exception | ||||
|---|---|---|---|---|---|
| Submitted: | 2010-03-25 21:31 UTC | Modified: | 2010-04-01 21:37 UTC | ||
| From: | stas at zend dot com | Assigned: | stas (profile) | ||
| Status: | Closed | Package: | Scripting Engine problem | ||
| PHP Version: | 5.3SVN-2010-03-25 (SVN) | OS: | * | ||
| Private report: | No | CVE-ID: | None | ||
[2010-03-25 21:31 UTC] stas at zend dot com
Description:
------------
The test script code produces the following error:
[25-Mar-2010 13:25:29] PHP Fatal error: Function name must be a string in test.php on line 0
This is because there's actually two errors:
1. Undefined $empty notice
2. Function name must be string - fatal error
When error (1) is processed, due to the exception opline_ptr is set to the exception handler opcode, so when the engine wants to report error (2) it doesn't have proper opline_ptr to report the error.
Test script:
---------------
<?php
function eh()
{
throw new Exception("error!");
return false;
}
set_error_handler("eh");
$a = $empty($b);
Expected result:
----------------
[25-Mar-2010 13:25:29] PHP Fatal error: Function name must be a string in test.php on line 9
Actual result:
--------------
[25-Mar-2010 13:25:29] PHP Fatal error: Function name must be a string in test.php on line 0
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2010-04-01 21:37 UTC] stas@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
[2010-04-01 21:37 UTC] stas@php.net