从另一个类(资源表)中获取资源

I am looking for a way to load an array from another class, as in the Kohana Framework. But I fail to get the message Notice: Undefined variable: tab1

<?php

class A {
    private $tab1 = array('raz'=>true, 'dwa'=>false);
    private $tab2 = array('trzy'=>false, 'cztery'=>true);
    public function config($var) {
        return $$var;
    }
}

class B {
    public function get() {
        $ob = new A;
        $tab = $ob->config('tab1');
        //unset($ob)
        return $tab;
    }
}

$ob=new B;
$tab = $ob->get();

print_r($tab);
 return $this->$var;

is correct. Use it instead of

return $$var;

Try this:

public function config($var){

  return $this->$var;

}