Rx\Observable::skipWhileWithIndex PHP Method

skipWhileWithIndex() public method

Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function.
public skipWhileWithIndex ( callable $predicate ) : Rx\Observable\AnonymousObservable
$predicate callable A function to test each element for a condition; the first parameter of the function represents the index of the source element, the second parameter is the value.
return Rx\Observable\AnonymousObservable An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
    public function skipWhileWithIndex(callable $predicate)
    {
        $index = 0;
        return $this->skipWhile(function ($value) use($predicate, &$index) {
            return call_user_func_array($predicate, [$index++, $value]);
        });
    }