I recall reading on php.net (although unfortunately can’t seem to find the page) that the PHP interpreter can run in different ways – most commonly, every time a page is requested, an instance of the PHP interpreter is created, runs its course, and then is destroyed, along with all the memory associated with that particular page call. Apparently, it is also possible to allow all the memory to linger, so that it can be used again in future page calls; as I understood it, essentially allowing multiple different PHP scripts to access and modify the same objects, without losing them after the script is complete.
Or at least, so I remember. Is there any truth to this? If so, how would I set it up?
php doesn’t work that way. its about run and forget.
you can save data between requests using userland shared memory extensions, for example: apc, xcache, memcached, etc.
or by using the session data array after calling session_start
don’t think of php scripts like a java application in e.g. tomcat. standard php was not designed for that use case. php compiler works on-the-fly.