public static function connect($server_credentials = [], $new_link = true, $client_flags = 0) { extract($server_credentials); // Validate required elements if ('' === $server || null === $server) { throw new Exception(sprintf('Invalid $value: %s', serialize($server_credentials))); // TODO: spl error } self::$_link = mysql_connect($server, $username, $password, $new_link, $client_flags); }