Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

PHP | Imagick clone() Function

  • Last Updated : 25 Jul, 2019

The Imagick::clone() function is an inbuilt function in PHP which is used to create a copy of Imagick object. This function creates copy of the same instance, that means it will have same properties and any change in it will not reflect to the main object.


Imagick Imagick::clone( void )

Parameters: This function does not accepts any parameters.

Return Value: It returns a copy of Imagick object.

Below program illustrates the Imagick::clone() function in PHP:


// Create new Imagick object
$image = new Imagick(
// Use clone() function to copy the image
$im_clone = clone $image;
header("Content-Type: image/gif");
// Display the image
echo $im_clone->getImagesBlob();

clone image


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!