You are here

public function ArrayObject::__get in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-stdlib/src/ArrayObject.php \Zend\Stdlib\ArrayObject::__get()

Returns the value at the specified key by reference

Parameters

mixed $key:

Return value

mixed

File

vendor/zendframework/zend-stdlib/src/ArrayObject.php, line 129

Class

ArrayObject
Custom framework ArrayObject implementation

Namespace

Zend\Stdlib

Code

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 Exception\InvalidArgumentException('$key is a protected property, use a different key');
  }
  return $this->{$key};
}