cvs: ZendEngine2 / ZEND_CHANGES
| From: | Sebastian Bergmann | Date: | Tue, 03 Feb 2004 16:56:37 +0000 |
| Subject: | cvs: ZendEngine2 / ZEND_CHANGES | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2309@lists.php.net to get a copy of this message | ||
sebastian Tue Feb 3 11:56:37 2004 EDT
Modified files:
/ZendEngine2 ZEND_CHANGES
Log:
clone/__clone() related changes.
http://cvs.php.net/diff.php/ZendEngine2/ZEND_CHANGES?r1=1.71&r2=1.72&ty=u
Index: ZendEngine2/ZEND_CHANGES
diff -u ZendEngine2/ZEND_CHANGES:1.71 ZendEngine2/ZEND_CHANGES:1.72
--- ZendEngine2/ZEND_CHANGES:1.71 Tue Dec 30 08:28:31 2003
+++ ZendEngine2/ZEND_CHANGES Tue Feb 3 11:56:37 2004
@@ -289,13 +289,12 @@
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 @@
print $obj->id . "\n";
- $obj = $obj->__clone();
+ $obj = clone $obj;
print $obj->id . "\n";
print $obj->name . "\n";