public function handle($running_env = self::DEFAULT_ENVIRONMENT, callable $callback = null)
    {
        $is_handled = false;
        if (!$this->is_handling && !$this->last_error) {
            $this->swapCallable($running_env, $callback, $this->running_env, false);
            $this->setRunningEnvironment($running_env);
            if ($callback) {
                $this->setCallback($callback);
            }
            
            $this->prev_exception_handler = set_exception_handler($this->getUncaughtExceptionHandler());
            $this->prev_error_handler     = set_error_handler($this->getCoreErrorHandler());
            register_shutdown_function(function() {
                    if ($error = error_get_last()) {
                        $this->handleCoreError(
                            $error["type"],
                            $error["message"],
                            $error["file"],
                            $error["line"]
                        );
                    }
                });
            
            $this->is_handling = true;
            $is_handled = true;
        }

        return $is_handled;
    }
public function handle($running_env = self::DEFAULT_ENVIRONMENT, callable $callback = null)
    {
        $is_handled = false;
        if (!$this->is_handling && !$this->last_error) {
            $this->swapCallable($running_env, $callback, $this->running_env, false);
            $this->setRunningEnvironment($running_env);
            if ($callback) {
                $this->setCallback($callback);
            }
            
            $this->prev_exception_handler = set_exception_handler($this->getUncaughtExceptionHandler());
            $this->prev_error_handler     = set_error_handler($this->getCoreErrorHandler());
            register_shutdown_function(function() {
                    if ($error = error_get_last()) {
                        $this->handleCoreError(
                            $error["type"],
                            $error["message"],
                            $error["file"],
                            $error["line"]
                        );
                    }
                });
            
            $this->is_handling = true;
            $is_handled = true;
        }

        return $is_handled;
    }
public function handle ( $ running_env = self :: DEFAULT_ENVIRONMENT , callable $ callback = null ) { $ is_handled = false ; if ( ! $ this -> is_handling && ! $ this -> last_error ) { $ this -> swapCallable ( $ running_env , $ callback , $ this -> running_env , false ) ; $ this -> setRunningEnvironment ( $ running_env ) ; if ( $ callback ) { $ this -> setCallback ( $ callback ) ; } $ this -> prev_exception_handler = set_exception_handler ( $ this -> getUncaughtExceptionHandler ( ) ) ; $ this -> prev_error_handler = set_error_handler ( $ this -> getCoreErrorHandler ( ) ) ; register_shutdown_function ( function ( ) { if ( $ error = error_get_last ( ) ) { $ this -> handleCoreError ( $ error [ "type" ] , $ error [ "message" ] , $ error [ "file" ] , $ error [ "line" ] ) ; } } ) ; $ this -> is_handling = true ; $ is_handled = true ; } return $ is_handled ; }
Starts handling errors

Returns true when errors are now being handled, or false when errors were already
being handled. Possibly because ::handle() had already been called, or an error has
already been handled.

Examples:
```
$handler = new ErrorHandler();
$handler->handle();

$handler = new ErrorHandler();
$handler->setCallback(function() { echo "Look out!"; });
$handler->handle();

$handler = new ErrorHandler();
$handler->setRunningEnvironment("live");
$handler->setCallback("live", function() { echo "Look out!"; });
$handler->handle();

$handler = new ErrorHandler();
$handler->handle("live", function() { echo "Look out!"; });
```

@param  string   $running_env The running environment
@param  callable $callback    The error callback
@return bool
Starts handling errors