class Klass { private $vars = array( 'foo' => 'foodefault', 'bar' => 'bardefault' ); function __set($property, $value) { if ( array_key_exists( $property, self::vars ) ) { self::vars($property) = $value; } } function __get($property) { if ( array_key_exists( $property, self::vars ) ) { return self::vars($property); } else { return false; } } }