src/Datastructure/Graph/Tree/Heap/MinHeap.php
public function length(): int {
        $array = \array_filter($this->heap, function ($v, $k) {
            return $v !== null;
        }, \ARRAY_FILTER_USE_BOTH);
        return \count($array) - 1;
    }
public function length(): int {
        $array = \array_filter($this->heap, function ($v, $k) {
            return $v !== null;
        }, \ARRAY_FILTER_USE_BOTH);
        return \count($array) - 1;
    }
public function length ( ) : int { $ array = \ array_filter ( $ this -> heap , function ( $ v , $ k ) { return $ v !== null ; } , \ ARRAY_FILTER_USE_BOTH ) ; return \ count ( $ array ) - 1 ; }
returns the number of elements in the heap

@return int
returns the number of elements in the heap