News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Fabien Potencier's Blog:
PHP Serialization, Stack Traces, and Exceptions
February 11, 2009 @ 10:27:54

Fabien Potencier has a new post about a strange and hard to track down bug he was experiencing with serializing a symfony form - it was throwing a PDO exception.

This exception is thrown by PDO because PDO instances are not serializable for good reasons. But it is weird because the sfForm class does not depend on PDO. How is it possible?

After some poking around, he noticed that this was only an issue for those with sessions stored in the database (that's where the PDO comes in). The problem came with the validation error class - it extends the exception class and, because of how the error handling serializes the exception, it tries to serialize the PDO connection that's in the stack trace too.

His solution is to use a Serializable interface to define exactly what you want serialized and passed back out as the error to the rest of your script.

0 comments voice your opinion now!
stacktrace exception serialize pdo sfform symfony framework


blog comments powered by Disqus

Similar Posts

Michael Kimsal's Blog: Grails for PHP developers series

Reddit.com: Frameworks, is the learning curve too steep

PRADO Watch Blog: PRADO Watch: Interview With Timani Tunduwani - Why I Moved From CakePHP to PRADO

NETTUTS.com: Getting Started With CakePHP

Alexander Netkachev's Blog: Using Zend_Controller in subfolder


Community Events

Don't see your event here?
Let us know!


podcast laravel language interview wordpress api laravel5 introduction community framework example series library unittest version opinion voicesoftheelephpant extension php7 release

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework