Deprecated: Optional parameter $keys declared before required parameter $cms_id is implicitly treated as a required parameter in /home/www/dev/work/class/blog/CmsKey.php on line 75

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$title is deprecated in /home/www/dev/work/website/lvesu/class/controller/blog/php.php on line 28

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$outlink is deprecated in /home/www/dev/work/website/lvesu/template/blog/cms/php.manual.tpl on line 2

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$status is deprecated in /home/www/dev/work/website/lvesu/template/blog/index.head.php on line 2
PHP - Manual: imap_gc - 互联网笔记

略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: imap_gc

2025-06-23

imap_gc

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

imap_gcClears IMAP cache

说明

imap_gc(IMAP\Connection $imap, int $flags): true

Purges the cache of entries of a specific type.

参数

imap

IMAP\Connection 实例。

flags

Specifies the cache to purge. It may one or a combination of the following constants: IMAP_GC_ELT (message cache elements), IMAP_GC_ENV (envelope and bodies), IMAP_GC_TEXTS (texts).

返回值

总是返回 true

错误/异常

Throws a ValueError if flags is invalid.

更新日志

版本 说明
8.1.0 现在 imap 参数接受 IMAP\Connection 实例,之前接受有效的 imap resource
8.0.0 A ValueError is now thrown on invalid flags parameter values. Previously, a warning was emitted and the function returned false.

示例

示例 #1 imap_gc() example

<?php

$mbox
= imap_open("{imap.example.org:143}", "username", "password");

imap_gc($mbox, IMAP_GC_ELT);

?>
添加备注

用户贡献的备注 1 note

up
3
Anonymous
15 years ago
If you notice that you're program's memory usage is increasing (as observed using ps) while calling the imap functions, calling this function should free that memory.

官方地址:https://www.php.net/manual/en/function.imap-gc.php

冷却塔厂家 广告
中文GPT4.0无需注册 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3