Hi List,

I have a class with a constructor that sets the variables and I currently
use functions to return each one. When using alot of variables in the
constructor i tend to have many return functions. Is there a way to access
the constructor variables without using a return function?

This is how I do it:

class MyClass {
    function MyClass {
        $this->var1="1";
        $this->var2="2";
    }
    function GetVar1() {
        return $this->var1;
    }
    function GetVar2() {
        return $this->var2;
    }
}

Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to