src/PhpErrorController.php
public function on_fatal() {

		$last_error = error_get_last();
		if ( ! $last_error ) {
			return;
		}

		$error = array_merge( [ 'type' => -1, 'message' => '', 'file' => '', 'line' => 0 ], $last_error );

		$fatals = [
			E_ERROR,
			E_PARSE,
			E_CORE_ERROR,
			E_CORE_WARNING,
			E_COMPILE_ERROR,
			E_COMPILE_WARNING,
		];

		if ( in_array( $error[ 'type' ], $fatals, TRUE ) ) {
			$this->on_error( $error[ 'type' ], $error[ 'message' ], $error[ 'file' ], $error[ 'line' ] );
		}
	}
public function on_fatal() {

		$last_error = error_get_last();
		if ( ! $last_error ) {
			return;
		}

		$error = array_merge( [ 'type' => -1, 'message' => '', 'file' => '', 'line' => 0 ], $last_error );

		$fatals = [
			E_ERROR,
			E_PARSE,
			E_CORE_ERROR,
			E_CORE_WARNING,
			E_COMPILE_ERROR,
			E_COMPILE_WARNING,
		];

		if ( in_array( $error[ 'type' ], $fatals, TRUE ) ) {
			$this->on_error( $error[ 'type' ], $error[ 'message' ], $error[ 'file' ], $error[ 'line' ] );
		}
	}
public function on_fatal ( ) { $ last_error = error_get_last ( ) ; if ( ! $ last_error ) { return ; } $ error = array_merge ( [ 'type' => - 1 , 'message' => '' , 'file' => '' , 'line' => 0 ] , $ last_error ) ; $ fatals = [ E_ERROR , E_PARSE , E_CORE_ERROR , E_CORE_WARNING , E_COMPILE_ERROR , E_COMPILE_WARNING , ] ; if ( in_array ( $ error [ 'type' ] , $ fatals , TRUE ) ) { $ this -> on_error ( $ error [ 'type' ] , $ error [ 'message' ] , $ error [ 'file' ] , $ error [ 'line' ] ) ; } }
Checks for a fatal error, work-around for `set_error_handler` not working with fatal errors.
Checks for a fatal error work - around for set_error_handler not working with fatal errors .