src/Map.php
public function remove($key, $default = null)
    {
        foreach ($this->pairs as $position => $pair) {
            if ($this->keysAreEqual($pair->key, $key)) {
                return $this->delete($position);
            }
        }

        // Check if a default was provided
        if (func_num_args() === 1) {
            throw new \OutOfBoundsException();
        }

        return $default;
    }
public function remove($key, $default = null)
    {
        foreach ($this->pairs as $position => $pair) {
            if ($this->keysAreEqual($pair->key, $key)) {
                return $this->delete($position);
            }
        }

        // Check if a default was provided
        if (func_num_args() === 1) {
            throw new \OutOfBoundsException();
        }

        return $default;
    }
public function remove ( $ key , $ default = null ) { foreach ( $ this -> pairs as $ position => $ pair ) { if ( $ this -> keysAreEqual ( $ pair -> key , $ key ) ) { return $ this -> delete ( $ position ) ; } } // Check if a default was provided if ( func_num_args ( ) === 1 ) { throw new \ OutOfBoundsException ( ) ; } return $ default ; }
Removes a key's association from the map and returns the associated value
or a provided default if provided.

@param mixed $key
@param mixed $default

@return mixed The associated value or fallback default if provided.

@throws \OutOfBoundsException if no default was provided and the key is
not associated with a value.
Removes a key s association from the map and returns the associated value or a provided default if provided .