name = $name; $this->color = $color; $this->breed = $breed; } public function getColor() { return $this->color; } public function test(Dog $dog) { $dog->color = 'Brown'; } } // some examples $mydog = new Dog('Rover', 'Red', 'Labrador'); // prints out 'Red' echo $mydog->getColor(); $anotherdog = new Dog('', '', ''); $anotherdog->test($mydog); // prints out 'Brown' echo $mydog->getColor(); ?>