ZF-10706: Call to a member function last() on a non-object in Zend/Session/SessionManager.php on line 339

Issue Type: Bug Created: 2010-11-18T07:46:35.000+0000 Last Updated: 2010-11-18T08:37:02.000+0000 Status: Resolved Fix version(s): - Next Major Release ()

Reporter: Alexander Thomas (fanatique) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Session

Related issues: Attachments:


Zend\Session\SessionManager::isValid() throws an error as it relies on $response being an object with a method last() while it obviously can be null.

The following code provokes this the error reproducable:

$session = new \Zend\Session\Container('test'); $session->test = 42;


Posted by Matthew Weier O'Phinney (matthew) on 2010-11-18T08:37:01.000+0000

Fixed in ZF2 master branch.

The issue was actually with SignalSlot. Signals::emitUntil() was not returning a ResponseCollection if no handlers were present; this is now fixed. Additionally, ResponseCollection::last() would then raise an exception if the collection was empty, as you can't return a value normally. I've modified it to return null when the collection is empty.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.