singleton config file
<p>Hey Guys I have a problem with a class and singleton method:
I make this class whith the intention of use config values inside others class:</p>

<pre><code>&lt;?
class Config {


    public $values=array();
    protected static $_instance = null;

    //Getters
    function __get($prop) {
        return $this-&gt;values[$key];
    }

    //Setters   
    function __set($key, $value) {
        $this-&gt;values[$key]=$value;
    }

    //Singleton
    public static function getInstance() {
        if (self::$_instance === null) {
            $c = __CLASS__;
            self::$_instance = new $c;           
        }
        return self::$_instance;
    }
}?&gt;
</code></pre>

<p>I make a instance whith values of my conection:</p>

<pre><code>$config=new Config();
$config-&gt;conex=array(
    'database' =&gt; 'lala',
    'user' =&gt; 'lala',
    'password' =&gt; 'lala',
    'server' =&gt; 'localhost'
);
</code></pre>

<p>But when I call singleton method inside database class the values are lost:</p>

<pre><code>$config = Config::getInstance();
print_r($config-&gt;conex);
</code></pre>

<p>Why is the problem?</p>
