Using Zend Framework 2 I have had invalid function calls go directly to Session.writeClose. However, from what I can tell this call is valid:
$encryptedData = mcrypt_encrypt(static::MCRYPT_CIPHER, $key, $data, static::MCRYPT_MODE, $initializationVector);
When I get these falling directly to writeClose I can never figure out what the real issue is. It gets lost in the closing of the session. Does anyone have any pointers about how to figure out what the real issue is? Try..catches don't work because there is no error. There is just going to closing of the session.
The final analysis of this was that whenever I attempt to call a function that does not exist, or a function with invalid parameters it goes directly to writeClose(). Now when I see that behavior I know to look at my function call and make sure it is valid.