So I know that Zend does this in some way, but I'm not sure how. I also found this a hard topic to google on.

Code PHP:
class my_class {
  private $var1; //I'd like to do this based on my_func input
  public function my_func($arr) {
    foreach ($arr as $var) {
       $this->$var = null;

This might not make sense looking at it, but what I want to do is be able to introduce a new private variable to be used within the class. While this MAY work as is, I'm not able to define public/private. Any ideas?