set_error_handler scope problems?

From: Date: Thu, 17 May 2001 11:29:21 +0000
Subject: set_error_handler scope problems?
Groups: php.general 
Request: Send a blank email to php-general+get-53219@lists.php.net to get a copy of this message
I'm trying to use set_error_handler with a function name (in the global scope -- not a class method), and I'm getting a seg-fault in PHP. I'm wondering if it's a scope problem. Here's an abbreviation of what I have: (Main.php) include_once('Error.php'); class Main { function main() { Main::_initDB(); } funtion _initDB() { Error::setErrorHandler('_handleError'); } } (Error.php) function _handleError(...) { // handle the error here } class Error { function setErrorHandler($functionName) { set_error_handler($functionName); } } I'm wondering if there's a scope problem here. I haven't fully explored the possibility that maybe my error-handling code is causing an error, but I'm wondering if anyone else has had a problem like this. It seems that perhaps PHP has a scope problem when I call set_error_handler() inside a class method (it's a static method, but PHP doesn't know the diff). Any thoughts? Dean.

« previous php.general (#53219) next »