creating fly variable
<p>Need load parameters to function, creating a variable name on the fly terrible thing, but I do not see another solution. This code contains an error please help</p>

<pre><code>&lt;?php 

class A{

  public $vars;
  public $tab_names;

  public $tab_names = array('car'=&gt;'audi', 'honda' =&gt; 'name');
  public $tab_fruits = array('name'=&gt;'banana', 'banana'=&gt;'fruit');

public function load($varr){

  $$varr;

  $this-&gt;vars = $varr;

}

public function display(){

  return  $this-&gt;vars;

}  

}

$ob = new A;
$ob-&gt;load('tab_names');
$ob-&gt;display();



?&gt;
</code></pre>
