src/Observable.php
public function takeWhileWithIndex(callable $predicate): Observable
    {
        $index = 0;
        return $this->takeWhile(function ($value) use ($predicate, &$index) {
            return $predicate($index++, $value);
        });
    }
public function takeWhileWithIndex(callable $predicate): Observable
    {
        $index = 0;
        return $this->takeWhile(function ($value) use ($predicate, &$index) {
            return $predicate($index++, $value);
        });
    }
public function takeWhileWithIndex ( callable $ predicate ) : Observable { $ index = 0 ; return $ this -> takeWhile ( function ( $ value ) use ( $ predicate , & $ index ) { return $ predicate ( $ index ++ , $ value ) ; } ) ; }
Returns elements from an observable sequence as long as a specified condition is true.  It takes as a parameter a
a callback to test each source element for a condition.  The callback predicate is called with the index and the
value of the element.

@param callable $predicate
@return Observable

@demo take/takeWhileWithIndex.php
@operator
@reactivex takeWhile
Returns elements from an observable sequence as long as a specified condition is true . It takes as a parameter a a callback to test each source element for a condition . The callback predicate is called with the index and the value of the element .