]> granicus.if.org Git - php/commitdiff
clone/__clone() related changes.
authorSebastian Bergmann <sebastian@php.net>
Tue, 3 Feb 2004 16:56:37 +0000 (16:56 +0000)
committerSebastian Bergmann <sebastian@php.net>
Tue, 3 Feb 2004 16:56:37 +0000 (16:56 +0000)
Zend/ZEND_CHANGES

index 85c7c5203e309187fc0af6ea584689c81ace3733..80d9f2c1076c1b8d7fe5486747f6d89d81df304e 100644 (file)
@@ -289,13 +289,12 @@ Changes in the Zend Engine 2.0
       replicate the parent object you want to create a new instance of
       this other object so that the replica has its own separate copy.
 
-      An object copy is created by calling the object's __clone()
-      method.
+      An object copy is created by using the clone operator.
 
       Example:
 
         <?php
-        $copy_of_object = $object->__clone();
+        $copy_of_object = clone $object;
         ?>
 
       When the developer asks to create a new copy of an object, the
@@ -333,7 +332,7 @@ Changes in the Zend Engine 2.0
 
         print $obj->id . "\n";
 
-        $obj = $obj->__clone();
+        $obj = clone $obj;
 
         print $obj->id . "\n";
         print $obj->name . "\n";