Forwarded Message Date: Wed, 24 Sep 2003 07:17:05 -0700 (PDT) From: "--" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: __clone() questions ???
Plain Text Attachment [ Save to my Yahoo! Briefcase | Download File ] Hello srs, Q 1. Will the methode __clone() have the posibility of take arguments ???? It would be usefull to reinitialize the clone: <? class Ovelha { var $age; var $owner; function __construct($age, $owner) { $this->age = $age; $this->owner = $owner; } function __clone($owner) { $this->age = 0; $this->owner = $owner; } } $molly = new Ovelha(2, "Eduardo"); $dolly = $molly->__clone("Igor"); print $dolly->owner; print $dolly->age; ?> Warning: Clone method does not require arguments thatīs sure one can create a wrapper function that initializes it, but.... Q 2. In some old docs, Iīve read the following: For convenience, the engine will suply a function that imports all of the properties from the source object, so they can start a by-value replica of the object, and only override properties that need to be changed. [The function hasnīt been implemented yet]. How is it actualy????? __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com Forwarded Message Date: Wed, 24 Sep 2003 14:43:35 +0000 From: "Curt Zirzow" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Re: [PHP] __clone() questions ??? Plain Text Attachment [ Save to my Yahoo! Briefcase | Download File ] * Thus wrote -- ([EMAIL PROTECTED]): > Hello srs, > > Q 1. > > Will the methode __clone() have the posibility of > take arguments ???? It would be usefull to > reinitialize the clone: >Wont the clone() not be a clone anymore? >Curt >-- >"I used to think I was indecisive, but now I'm not so >sure." So.... About Question 1, How do you re-set properties in the clone at the time it is cloned... as it is done in the constructor???? And has someone any answer to Question 2?????? regards, Eduardo R. Maciel __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php