src/Axolotl/Collection.php
protected function count_while_true( $condition ) {
		$count = 0;

		foreach ( $this->elements as $element ) {
			if ( ! $condition($element) ) {
				break;
			}
			$count++;
		}

		return $count;
	}
protected function count_while_true( $condition ) {
		$count = 0;

		foreach ( $this->elements as $element ) {
			if ( ! $condition($element) ) {
				break;
			}
			$count++;
		}

		return $count;
	}
protected function count_while_true ( $ condition ) { $ count = 0 ; foreach ( $ this -> elements as $ element ) { if ( ! $ condition ( $ element ) ) { break ; } $ count ++ ; } return $ count ; }
Number of elements true for the condition.

@param callable $condition Condition to check.
@return int
Number of elements true for the condition .