I am having some problems with cloning data objects using PHP5. First for some background:: I have a data object which represents a tuple in a database, which contains a list of fields. When you create a DataObject it looks up the database to get the fields names, however when I'm creating a collection of these objects, this gets very costly. I have devised a way to do only one query to get all the data, but now am working on getting only one object constructor called and then cloning the object. Here is the old code: [code] foreach($rows as $id=>$row) { $do = new $this->_doname; $do->_data=$row; $do->load($id); $this->_dataobjects[] = $do; }[/code] I changed this to: [code] $temp = new $this->_doname; foreach($rows as $id=>$row) { $do = clone $temp; $do->_data=$row; $do->load($id); $this->_dataobjects[] = $do; }[/code] However when I create a collection, all the dataobjects in the the array are the same. I have tried : [code]$this->_dataobjects[] = clone $do;[/code] and unsetting $do after use, but no luck. If I print_r the _dataobjects array in the loop using for example a collection of fruit I get: 1st run apple 2nd run pear pear 3rd run grapes grapes grapes etc.. Any help much appreciated.