PHP更好地(un)序列化或重新声明一个类?

I've got a class which is used in several pages, but none of its data needs to be persistent.

Is it better practice (or performance) to

A) include and redefine the class each time I use it, or

B) serialize it into a session variable the first time and unserialize it when necessary?

If you don't need its state, you don't need to ever serialise it.

Just include it when you need to, or take advantage of class autoloading. spl_autoload_register() is your friend.

You can't unserialize a class which has not been defined. PHP will throw an error at you.

You must necessarily include the class definition.