The __clone Wars

From: Date: Mon, 19 Jan 2004 20:52:55 +0000
Subject: The __clone Wars
Groups: php.internals 
Request: Send a blank email to internals+get-7192@lists.php.net to get a copy of this message
(Sorry for the subject, I couldn't resist). It seems that the parent class's variables are not being copied per bit by the default implementation, so how should a superclasses __clone() method be dealt with? In other words, should it be like this: public function __clone() { $this = parent::__clone(); $this->... = $that->... } P.S. Perhaps the $this object should already be set using the default implementation, and then the user could override certain properties if he so wishes; I believe the preliminary documentation says that this is the case, but it doesn't work like this.

« previous php.internals (#7192) next »