All pastes #276474 Raw Edit

Mine

public php v1 · immutable
·published 2006-12-12 11:10 UTC
rendered paste body
<?phppublic class Dog {private $name;private $color;private $breed;public function Dog($name, $color, $breed) {   $this->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();?>