class Staff
{
var $name;
function __set($propName, $propValue)
{
$this->$propName = $propValue;
}
}
$employee = new Staff();
$employee->name = "Joe";
$employee->title = "Programmer";
echo "Name: ".$employee->name;
echo "
";
echo "Title: ".$employee->title;
?>