public function &__get($key)
    {
        $ret = null;

        if ($this->flag == self::ARRAY_AS_PROPS) {
            $ret =& $this->offsetGet($key);

            return $ret;
        }

        if (in_array($key, $this->protectedProperties)) {
            throw new \InvalidArgumentException('$key is a protected property, use a different key');
        }

        return $this->$key;
    }
public function &__get($key)
    {
        $ret = null;

        if ($this->flag == self::ARRAY_AS_PROPS) {
            $ret =& $this->offsetGet($key);

            return $ret;
        }

        if (in_array($key, $this->protectedProperties)) {
            throw new \InvalidArgumentException('$key is a protected property, use a different key');
        }

        return $this->$key;
    }
public function & __get ( $ key ) { $ ret = null ; if ( $ this -> flag == self :: ARRAY_AS_PROPS ) { $ ret = & $ this -> offsetGet ( $ key ) ; return $ ret ; } if ( in_array ( $ key , $ this -> protectedProperties ) ) { throw new \ InvalidArgumentException ( '$key is a protected property, use a different key' ) ; } return $ this -> $ key ; }
Returns the value at the specified key by reference

@param  mixed $key

@throws \InvalidArgumentException
@return mixed
Returns the value at the specified key by reference