php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36773 error_handler with thrown exception
Submitted: 2006-03-17 16:08 UTC Modified: 2006-03-17 20:44 UTC
From: nikolai dot zujev at gmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.1.2 OS: Linux
Private report: No CVE-ID: None
 [2006-03-17 16:08 UTC] nikolai dot zujev at gmail dot com
Description:
------------
Could not catch exception throw from error_handler function.
I couldn't do it only in this situation, other works well.
order of errors: 
  NOTICE: Undefined variable ...
  FATAL: Class name must be a ...

Reproduce code:
---------------
<?php
error_reporting( E_ALL );
set_error_handler( 'error_handler' );

function error_handler( $errno, $errstr, $errfile, $errline )
{
    echo "($errno) $errstr\n";
    throw new Exception( $errstr, $errno );
}

class someClass { /*....*/ }

unset( $test );

$o = new $test;
?>

Expected result:
----------------
Uncaughted exception message ... with trace.

Actual result:
--------------
non-readable core dump or smth like this.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-17 17:16 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip

I don't see any coredumps or any other problems.
 [2006-03-17 20:44 UTC] nikolai dot zujev at gmail dot com
Thanx, great!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 04:01:28 2024 UTC