©
本文檔使用 php中文網手册 發布
(PECL imagick 2.0.0)
Imagick::clear — Clears all resources associated to Imagick object
Clears all resources associated to Imagick object
成功时返回 TRUE
。
[#1] kd0bpv at gmail dot com [2014-03-05 22:31:29]
Imagick::destroy() has been deprecated in favor of Imagick::clear().
[#2] admin at dinacel dot com [2013-06-16 03:18:14]
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.
[#3] markus dot s dot schmitz at gmail dot com [2012-12-11 08:46:18]
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