<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Makes an exact copy of the Imagick object</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="imagick.clippathimage.html">Imagick::clipPathImage</a></div> <div class="next" style="text-align: right; float: right;"><a href="imagick.clutimage.html">Imagick::clutImage</a></div> <div class="up"><a href="class.imagick.html">Imagick</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="imagick.clone" class="refentry"> <div class="refnamediv"> <h1 class="refname">Imagick::clone</h1> <p class="verinfo">(PECL imagick 2.0.0)</p><p class="refpurpose"><span class="refname">Imagick::clone</span> — <span class="dc-title">Makes an exact copy of the Imagick object</span></p> </div> <div class="refsect1 description" id="refsect1-imagick.clone-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type"><a href="class.imagick.html" class="type Imagick">Imagick</a></span> <span class="methodname"><strong>Imagick::clone</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> Makes an exact copy of the Imagick object. </p> <div class="warning"><strong class="warning">Warning</strong> <p class="simpara"> This function has been <em class="emphasis">DEPRECATED</em> as of imagick 3.1.0 in favour of using the <a href="language.oop5.cloning.html" class="link">clone</a> keyword. </p> </div> </div> <div class="refsect1 examples" id="refsect1-imagick.clone-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-3313"> <p><strong>Example #1 Imagick object cloning in different versions of imagick</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// Cloning an Imagick object in imagick 2.x and 3.0:<br /></span><span style="color: #0000BB">$newImage </span><span style="color: #007700">= </span><span style="color: #0000BB">$image</span><span style="color: #007700">-></span><span style="color: #0000BB">clone</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// Cloning an Imagick object from 3.1.0 on:<br /></span><span style="color: #0000BB">$newImage </span><span style="color: #007700">= clone </span><span style="color: #0000BB">$image</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> <div class="refsect1 returnvalues" id="refsect1-imagick.clone-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> A copy of the Imagick object is returned. </p> </div> <div class="refsect1 changelog" id="refsect1-imagick.clone-changelog"> <h3 class="title">Changelog</h3> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>3.1.0</td> <td> The method was deprecated in favour of the <a href="language.oop5.cloning.html" class="link">clone</a> keyword. </td> </tr> </tbody> </table> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="imagick.clippathimage.html">Imagick::clipPathImage</a></div> <div class="next" style="text-align: right; float: right;"><a href="imagick.clutimage.html">Imagick::clutImage</a></div> <div class="up"><a href="class.imagick.html">Imagick</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>