Provide an explicit description of the order in which clone and __clone operate. #47587

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@276810 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Richard Quadling 2009-03-06 15:23:17 +00:00
parent 2c6df09723
commit 567afe32ad

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<sect1 xml:id="language.oop5.cloning" xmlns="http://docbook.org/ns/docbook">
<title>Object cloning</title>
@ -32,9 +32,12 @@ $copy_of_object = clone $object;
<para>
When an object is cloned, PHP 5 will perform a shallow copy of all of the
object's properties. Any properties that are references to other variables,
will remain references. If a __clone() method is defined, then the newly
created object's __clone() method will be called, to allow any necessary
properties that need to be changed.
will remain references.
</para>
<para>Once the cloning is complete, if a __clone() method is defined, then
the newly created object's __clone() method will be called, to allow any
necessary properties that need to be changed.
</para>
<example>