Passing constructor values to functions in a class

From: Terence (terence_at_sunway.edu.my)
Date: 10/31/03


To: <php-general@lists.php.net>
Date: Fri, 31 Oct 2003 11:38:47 +0800

Dear List,

I've been struggling with this for some time now and can't for the life of
me figure out why the output is "GeorgeGeorge" and not "GeorgeBush"

<?php
class StaffDetails {

 var $staff_name;
 var $staff_surname;

 function StaffDetails() {

  $this->$staff_name="George";
  $this->$staff_surname="Bush";
 }
 function StaffName() {
  echo $this->$staff_name;
 }
 function StaffSurname() {
  echo $this->$staff_surname;
 }
}
$sd = new StaffDetails();
$sd->StaffName();
$sd->StaffSurname();
?>

References to links or tutorials most welcome :)

Thanks in advance.