I have several classes which use static variables.
I assume that the classes are loaded into PHP when I include it in a php file being interpreted. Do I have to actively do anything to make sure that PHP does not ‘unload’ my class and I lose my static variables? Or does PHP simply never unload Classes once loaded? What if there’s no file being interpreted at the current time? (I’m using php-cgi for my webserver)
static variable values within a class are set and retained within the context of a request only. If you want data to persist beyond the scope of the request, you have to use a session variable or write to a file or database.