public function filter(callable $predicate): self
    {
        $intervals = array_filter($this->intervals, $predicate, ARRAY_FILTER_USE_BOTH);
        if ($intervals === $this->intervals) {
            return $this;
        }

        return new self(...$intervals);
    }
public function filter(callable $predicate): self
    {
        $intervals = array_filter($this->intervals, $predicate, ARRAY_FILTER_USE_BOTH);
        if ($intervals === $this->intervals) {
            return $this;
        }

        return new self(...$intervals);
    }
public function filter ( callable $ predicate ) : self { $ intervals = array_filter ( $ this -> intervals , $ predicate , ARRAY_FILTER_USE_BOTH ) ; if ( $ intervals === $ this -> intervals ) { return $ this ; } return new self ( ... $ intervals ) ; }
Filters the sequence according to the given predicate.

This method MUST retain the state of the current instance, and return
an instance that contains the interval which validate the predicate.
Filters the sequence according to the given predicate .