public static function environment( int $severity, array $configuration = [] ) {

    // setup error reporting in PHP
    $reporting = ~E_ALL;
    foreach( self::SEVERITY as $key => $value ) {
      if( $key <= $severity ) $reporting |= $value;
    }
    error_reporting( $reporting );

    // setup locale
    if( isset( $configuration[ 'locale' ] ) ) {
      setlocale( LC_ALL, $configuration[ 'locale' ] );
    }

    // setup encoding
    if( isset( $configuration[ 'encoding' ] ) ) {
      mb_internal_encoding( $configuration[ 'encoding' ] );
      mb_http_output( $configuration[ 'encoding' ] );
    }

    // setup timezones
    if( isset( $configuration[ 'timezone' ] ) ) {
      date_default_timezone_set( $configuration[ 'timezone' ] );
    }
  }