public function withoutParam(string $offset, string ...$offsets): self
    {
        $offsets[] = $offset;
        $mapper = static function (string $offset): string {
            return preg_quote($offset, ',').'(\[.*\].*)?';
        };

        $regexp = ',^('.implode('|', array_map($mapper, $offsets)).')?$,';
        $filter = static function (array $pair) use ($regexp): bool {
            return 1 !== preg_match($regexp, $pair[0]);
        };

        $pairs = array_filter($this->pairs, $filter);
        if ($pairs === $this->pairs) {
            return $this;
        }

        $clone = clone $this;
        $clone->pairs = $pairs;

        return $clone;
    }
public function withoutParam(string $offset, string ...$offsets): self
    {
        $offsets[] = $offset;
        $mapper = static function (string $offset): string {
            return preg_quote($offset, ',').'(\[.*\].*)?';
        };

        $regexp = ',^('.implode('|', array_map($mapper, $offsets)).')?$,';
        $filter = static function (array $pair) use ($regexp): bool {
            return 1 !== preg_match($regexp, $pair[0]);
        };

        $pairs = array_filter($this->pairs, $filter);
        if ($pairs === $this->pairs) {
            return $this;
        }

        $clone = clone $this;
        $clone->pairs = $pairs;

        return $clone;
    }
public function withoutParam ( string $ offset , string ... $ offsets ) : self { $ offsets [ ] = $ offset ; $ mapper = static function ( string $ offset ) : string { return preg_quote ( $ offset , ',' ) . '(\[.*\].*)?' ; } ; $ regexp = ',^(' . implode ( '|' , array_map ( $ mapper , $ offsets ) ) . ')?$,' ; $ filter = static function ( array $ pair ) use ( $ regexp ) : bool { return 1 !== preg_match ( $ regexp , $ pair [ 0 ] ) ; } ; $ pairs = array_filter ( $ this -> pairs , $ filter ) ; if ( $ pairs === $ this -> pairs ) { return $ this ; } $ clone = clone $ this ; $ clone -> pairs = $ pairs ; return $ clone ; }
Returns an instance without the specified params.

This method MUST retain the state of the current instance, and return
an instance that contains the modified component without PHP's value.
PHP's mangled is not taken into account.

@param string ...$offsets
Returns an instance without the specified params .