For OOP it's important to not copy. Each copy is a different object.
Suppose you have code like this:
function addPartToPage($page, $part) {
$page->addPart($part);
}
$myPage = new Page();
addPartToPage($myPage, new Header());
That won't do anything. More precicely, it'll create a copy of $myPage, add the part to it, then discard the copy. The original $myPage will not have any header added to it. You need to use a reference, like so:
function addPartToPage(&$page, &$part) {
The & causes the function arguments to be passed by reference.
For OOP it is normal to assign objects by reference. In PHP5, objects will be assigned by reference, by default. Most other object-oriented languages work that way.
Always use & when working with objects, unless you are absolutely certain that you want to copy your object.
Also, be aware that with PHP 4 some language constructs always copy. foreach, for example. So if you have code like this:
foreach ($this->parts as $part) {
$part->html .= "<p>Blah!</p>";
}
it won't do anything to $html in the original $this->parts, because $part is a copy. That's why I used a traditional for loop in my example. It wouldn't have made a difference in my example (assuming render() doesn't change the state of the object), but it is a good practice to not copy your objects needlessly.