Hoa central
WeakStack.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Praspel\Iterator;
38 
47 class WeakStack extends \SplStack
48 {
54  public function valid()
55  {
56  while (
57  true === parent::valid() &&
58  null === $this->current() &&
59  null === parent::next()
60  );
61 
62  return parent::valid();
63  }
64 
71  public function isEmpty()
72  {
73  foreach ($this as $element) {
74  if (null !== $element) {
75  return false;
76  }
77  }
78 
79  return true;
80  }
81 }