title: What is the best way to auto generate getters and setters for a class in php?
body: <p>I regularly create a class that has a few private variables.
  When an instance of this class is set, it should be possible to fill all variables of the class with getters and setters.</p>
  
  <p>Is there an easy way to do this without having to type all these setters and getters for each variable on creation of the class?</p>
  
  <p>now i have to type this for each var in the class</p>
  
  <pre><code>public function setVar($var){
  $this-&gt;var = $var;
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public function getVar(){
  return $this-&gt;var;
  }
  </code></pre>
  
  <p>We now use RegExp, but i don't know if this is the easiest way...
  We use Eclipse as environment, so perhaps there are some usefull plugins?</p>