|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-08-10 10:26 UTC] maus at hab dot de
[2012-08-10 13:35 UTC] olivier dot pons at gmail dot com
[2012-08-10 13:35 UTC] olivier dot pons at gmail dot com
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 18:00:02 2026 UTC |
Description: ------------ What is confusing (and is not documented yet) is that when you're in the "__clone" function the left operand concerns the destination (= new object) and the right operand concerns the source (= object to be cloned) _and_ you still use "$this"! Sample: public function __clone() { $this->myObj = clone $this->myObj; } It's confusing: assigning $this->variable to $this->variable. Test script: --------------- public function __clone() { $this->myObj = clone $this->myObj; } Expected result: ---------------- A note in http://php.net/clone section. Actual result: -------------- Not documented yet.