firstName = $firstName; $this->lastName = $lastName; $this->age = (int)$age; $this->sex = $sex; } public function getYearOfBirth() { $today = (int)date("Y"); // 2007 return $today - $this->age; } } $person = new Person('Claus','Joergensen',20,'male'); echo $person->getYearOfBirth(); // 1987 ... okay, a bit wrong :) I'm from '86 ?>