Index: tests/Zend/Http/UserAgentTest.php =================================================================== --- tests/Zend/Http/UserAgentTest.php (revision 23555) +++ tests/Zend/Http/UserAgentTest.php (revision ) @@ -565,4 +565,17 @@ $device = $userAgent->getDevice(); $groups = $device->getAllGroups(); } + + /** + * @group ZF-10665 + */ + public function testDontDieOnSerialization() + { + $config = $this->config; + $userAgent = new Zend_Http_UserAgent($config); + + // If this code doesn't throw a fatal error the test passed. + $userAgent->setUserAgent('userAgentTest'); + $userAgent->serialize(); -} + } +} Index: library/Zend/Http/UserAgent.php =================================================================== --- library/Zend/Http/UserAgent.php (revision 23483) +++ library/Zend/Http/UserAgent.php (revision ) @@ -174,8 +174,8 @@ $spec = array( 'browser_type' => $this->_browserType, 'config' => $this->_config, - 'device_class' => get_class($this->_device), - 'device' => $this->_device->serialize(), + 'device_class' => get_class($this->getDevice()), + 'device' => $this->getDevice()->serialize(), 'user_agent' => $this->getServerValue('http_user_agent'), 'http_accept' => $this->getServerValue('http_accept'), );