Ds\Stack::count

(PECL ds >= 1.0.0)

Ds\Stack::countReturns the number of values in the stack