History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-4576
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Ralph Schindler
Reporter: Ryan Korczykowski
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Zend_Session_Namespace::getIterator() returns ArrayObject instead of Iterator

Created: 12/Oct/08 12:32 PM   Updated: 15/Oct/08 02:25 PM
Component/s: Zend_Session
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Tags:
Participants: julien PAULI, Ralph Schindler and Ryan Korczykowski


 Description  « Hide
IteratorAggregate::getItterator should return instanceof Iterator: http://www.php.net/~helly/php/ext/spl/interfaceIteratorAggregate.html

Namespace returns ArrayObject which does not implement Iterator: http://www.php.net/~helly/php/ext/spl/classArrayObject.html

This is moot when using the namespace in a foreach since the foreach calls getItterator on the namespace, and again on the ArrayObject (Im think ).

Test:

Zend_Session::start();
$ns = new Zend_Session_Namespace('test-namespace');
assert($ns->getIterator() instanceof Iterator);

Possible Fix:

Zend_Session_Namespace 182:         return new ArrayIterator(parent::_namespaceGetAll($this->_namespace));

Version:
I don't know what version the trunk refers to, here is the @version annotation
$Id: Namespace.php 11003 2008-08-24 14:43:15Z matthew $



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
julien PAULI - 15/Oct/08 02:25 PM
You are rigth, it's called twice.

However, the patch could break backward compatibility as some users might use specific ArrayObject methods that would raise a fatal error.