remove() публичный Метод

Removes an item from the map by its key.
public remove ( $key ) : mixed
Результат mixed the removed value, null if no such key exists.
Пример #1
0
 public function testCanNotRemoveWhenReadOnly()
 {
     $map = new TMap(array('key' => 'value'), true);
     try {
         $map->remove('key');
     } catch (TInvalidOperationException $e) {
         return;
     }
     self::fail('An expected TInvalidOperationException was not raised');
 }
Пример #2
0
 /**
  * Removes an item from the map by its key.
  * This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false.
  * @param mixed the key of the item to be removed
  * @return mixed the removed value, null if no such key exists.
  */
 public function remove($key)
 {
     return parent::remove($this->_caseSensitive ? $key : strtolower($key));
 }