You are here

public function ArrayObject::__unset in Zircon Profile 8

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

Unsets the value at the specified key

Parameters

mixed $key:

Return value

void

File

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

Class

ArrayObject
Custom framework ArrayObject implementation

Namespace

Zend\Stdlib

Code

public function __unset($key) {
  if ($this->flag == self::ARRAY_AS_PROPS) {
    return $this
      ->offsetUnset($key);
  }
  if (in_array($key, $this->protectedProperties)) {
    throw new Exception\InvalidArgumentException('$key is a protected property, use a different key');
  }
  unset($this->{$key});
}