function public function ArrayObject::offsetGet

8.x-3.x ArrayObject.php public &ArrayObject::offsetGet($key, $default = NULL)

Returns the value at the specified key.

Parameters

mixed $key: A key.

mixed $default: The default value to set if $key does not exist.

Return value

mixed The value.

Class

ArrayObject
Custom ArrayObject implementation.

Namespace

Drupal\bootstrap\Utility

Source src/Utility/ArrayObject.php (line 315)

public function &offsetGet($key, $default = NULL) {
  if (!$this->offsetExists($key)) {
    $this->array[$key] = $default;
  }
  $ret = &$this->array[$key];
  return $ret;
}