FWIW I wrote a patch for this out of curiosity. Rather than relying on _iterationPointerValid, it simply uses an index pointer - if the index is equal to the length of the array length then 'valid()' will always return false. rewind() will reset this pointer to 0. If you find it useful I'll add it to the Bug tracker Cheers =================================================================== --- Config.php (revision 1090) +++ Config.php (working copy) @@ -35,7 +35,7 @@ class Zend_Config implements Countable, Iterator { protected $_allowModifications; - protected $_iterationPointerValid; + protected $_index = 0; protected $_data; /** @@ -179,21 +179,18 @@ */ public function next() { - if (next($this->_data) === false) { - $this->_iterationPointerValid = false; - } else { - $this->_iterationPointerValid = true; - } + next($this->_data); + $this->_index++; } /** * Defined by Iterator interface * */ - public function rewind () + public function rewind() { reset($this->_data); - $this->_iterationPointerValid = true; + $this->_index = 0; } /** @@ -201,9 +198,9 @@ * * @return boolean */ - public function valid () + public function valid() { - return $this->_iterationPointerValid; + return ($this->_index < count($this->_data)); } }
-- Simon Mundy | Director | PEPTOLAB """ " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" " 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 |
- [fw-general] Zend_Config_Array and iteration Irina Khmelinina
- Re: [fw-general] Zend_Config_Array and iteration Ahmed Shreef
- Re: [fw-general] Zend_Config_Array and iteration Irina Khmelinina
- Re: [fw-general] Zend_Config_Array and itera... Ahmed Shreef
- Re: [fw-general] Zend_Config_Array and i... Irina Khmelinina
- Re: [fw-general] Zend_Config_Array ... Ahmed Shreef
- Re: [fw-general] Zend_Config_Ar... Davey Shafik
- Re: [fw-general] Zend_Confi... Simon Mundy
- Re: [fw-general] Zend_Confi... Irina Khmelinina
- Re: [fw-general] Zend_Confi... Darby Felton
- Re: [fw-general] Zend_Confi... Rob Allen
