You Cannot Serialize Or Unserialize Pdo Instances Doctrine
The connection object is an instance of DatabaseConnection, which extends PDO PDO cannot be serialized, since it contains a resource. https://comcemouten.weebly.com/blog/harley-davidson-chopper-wallpaper-for-mac
So when you try to cache the theme variables, that works its way down the line to the connection object and explodes, which is exactly what the PHP engine says it should do. HERE