あるいは、こんなんでもいいけど、どっちがいい?

class Hoge
{
 private $p_id = null;
 private $p_name = null;
 private $p_gender = null;
 private $p_register_date = null;

(略)

 public function __set($key, $val){
  echo('__set called'.PHP_EOL);

  switch($key){
   case "id":
    $key = "p_{$key}";
    $this->$key = (int)$val; break;
   case "name":
    $key = "p_{$key}";
    $this->$key = (string)$val; break;
   case "gender":
    $key = "p_{$key}";
    $this->$key = (int)$val; break;
   case "register_date":
    $key = "p_{$key}";
    $this->$key = new DateTime($val); break;
   default:
    throw new Exception("Invalid parameter has been given.");
  }
 }
}