Edit report at http://bugs.php.net/bug.php?id=51394&edit=1
ID: 51394 Updated by: [email protected] Reported by: stas at zend dot com Summary: Error line reported incorrectly iif error handler throws an exception -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem Operating System: * PHP Version: 5.3SVN-2010-03-25 (SVN) -Assigned To: +Assigned To: stas New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2010-04-01 21:36:58] [email protected] Automatic comment from SVN on behalf of stas Revision: http://svn.php.net/viewvc/?view=revision&revision=297301 Log: fix #51394 - try harder to find script lineno when exception happens ------------------------------------------------------------------------ [2010-03-25 21:31:24] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51394&edit=1
