imagedestroy
PHP Manual
PHP Manual»Функції GD та Image»imagedestroy

imagedestroy

(PHP 4, PHP 5, PHP 7, PHP 8)

imagedestroyDestroy an image

Увага

This function has been DEPRECATED as of PHP 8.5.0. Relying on this function is highly discouraged.

Опис

#[\Deprecated]
function imagedestroy(GdImage $image): true

Зауваження:

Ця функція ні на що не впливає. До PHP 8.0.0, вона використовувалася для закриття ресурсу.

Prior to PHP 8.0.0, imagedestroy() freed any memory associated with the image resource. As of 8.0.0, the GD extension uses objects instead of resources, and objects cannot be explicitly closed.

Параметри

image

Об'єкт GdImage, що повертається однією з функцій створення зображення, такою як imagecreatetruecolor().

Значення, що повертаються

Завжди повертає true.

Журнал змін

Версія Опис
8.5.0 This function has been deprecated.
8.0.0 This function is a NOP now.
8.0.0 Тепер image має бути примірником GdImage. Раніше очікувався gd-resource.

Приклади

Приклад #1 Using imagedestroy() prior to PHP 8.0.0

<?php
// create a 100 x 100 image
$im = imagecreatetruecolor(100, 100);

// alter or save the image

// frees image from memory
imagedestroy($im);
?>

To Top