public static function decode( $data ) {
		if ( !is_string( $data ) ) {
			throw new \InvalidArgumentException( '$data must be a string' );
		}

		$format = ini_get( 'session.serialize_handler' );
		if ( !is_string( $format ) ) {
			throw new \UnexpectedValueException(
				'Could not fetch the value of session.serialize_handler'
			);
		}
		switch ( $format ) {
			case 'php':
				return self::decodePhp( $data );

			case 'php_binary':
				return self::decodePhpBinary( $data );

			case 'php_serialize':
				return self::decodePhpSerialize( $data );

			default:
				throw new \DomainException( "Unsupported format \"$format\"" );
		}
	}