略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Imagick::clear

2024-12-22

Imagick::clear

(PECL imagick 2, PECL imagick 3)

Imagick::clearClears all resources associated to Imagick object

说明

public Imagick::clear(): bool

Clears all resources associated to Imagick object

参数

此函数没有参数。

返回值

成功时返回 true

add a noteadd a note

User Contributed Notes 3 notes

up
18
kd0bpv at gmail dot com
8 years ago
Imagick::destroy() has been deprecated in favor of Imagick::clear().
up
-11
admin at dinacel dot com
9 years ago
Destroy and clear methods seem to do exactly the same thing
@see http://svn.php.net/viewvc/pecl/imagick/trunk/imagick_class.c?view=markup (l.3066 & l.3087)

The code is duplicated, they do the same thing a bit differently.
up
-16
markus dot s dot schmitz at gmail dot com
9 years ago
One might be suprised that there seems to be no difference between:

<?php
$imagick
= new Imagick();
$imagick->clear();
$imagick->readImage('myfile.jpg');
?>

and

<?php
$imagick
= new Imagick();
$imagick->destroy();
$imagick->readImage('myfile.jpg');
?>

Both functions reset all options and clear all used resources so you might want to use either one of them.
See also: http://php.net/manual/en/imagick.destroy.php

官方地址:https://www.php.net/manual/en/imagick.clear.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3