imagedestroy

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

imagedestroyDestroy an image

Avviso

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

Descrizione

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

Nota:

This function has no effect. Prior to PHP 8.0.0, this function was used to close the resource.

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.

Elenco dei parametri

image

Una risorsa immagine, restituita da una delle funzioni di creazione immagine, come imagecreatetruecolor().

Valori restituiti

Always returns true.

Log delle modifiche

Versione Descrizione
8.5.0 This function has been deprecated.
8.0.0 This function is a NOP now.
8.0.0 image expects a GdImage instance now; previously, a valid gd resource was expected.

Esempi

Example #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);
?>