function SB_errorHandler_handler($errno, $errstr, $errfile, $errline) { if (!SB_SHOW_PHP_ERRORS) { return; } global $SB_errorHandler__phpHandlerUsed; $SB_errorHandler__phpHandlerUsed++; $errHandler = new SB_ErrorHandler(); $pathParts = pathinfo($errfile); $location = $pathParts['basename'] . ' line ' . $errline; switch ($errno) { case E_ERROR: $errHandler->error("%s [%s]", array($errstr, $location)); break; // E_STRICT - PHP 5.0 wants access modifiers instead of var // We will wait and switch to the new way only when PHP 4.0 // is no more used (never?). // E_STRICT - PHP 5.0 wants access modifiers instead of var // We will wait and switch to the new way only when PHP 4.0 // is no more used (never?). case 2048: break; case E_WARNING: default: $errHandler->warn("%s [%s]", array($errstr, $location)); break; } }