current() && null === parent::next() ); return parent::valid(); } /** * Check whether the stack is empty or not. * An element is present if different of null. * * @return bool */ public function isEmpty() { foreach ($this as $element) { if (null !== $element) { return false; } } return true; } }