Jump to content

Problem with set_exception_handler


nuxy

Recommended Posts

I have a problem with the function set_exception_handler.

I can't seem to get it to work with it calling a function within a class.

 

set_exception_handler($en->handle_error);

When I try it that way, it reads the "error_handler" as a variable.

Notice: Undefined property: engine::$handle_error in index.php on line 19

 

set_exception_handler($en->handle_error());

When I try it that way, it reads as a function, but doesn't pass any variables to the function.

Warning: Missing argument 1 for engine::handle_error(), called in index.php on line 19 and defined in classes\engine.php on line 279
Warning: Missing argument 2 for engine::handle_error(), called in index.php on line 19 and defined in classes\engine.php on line 279
Warning: Missing argument 3 for engine::handle_error(), called in index.php on line 19 and defined in classes\engine.php on line 279
Warning: Missing argument 4 for engine::handle_error(), called in index.php on line 19 and defined in classes\engine.php on line 279

 

I have tried with just making a function in the "index.php" script, but it doesn't display anything then.

function handle_error($a, $b, $c, $d) {
global $en;
$en->handle_error($a, $b, $c, $d);
return;
}
set_exception_handler('handle_error');

 

Does anyone have an idea how I could fix this problem?

Link to comment
https://forums.phpfreaks.com/topic/98958-problem-with-set_exception_handler/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.