Hi all,
My initial response to Jonathan has me thinking more about this, and a higher level. I guess I want to hear from the Zend guys about their intentions of PHP as an app server. IMHO, that's the right direction.
For example, when PHP is loaded by the web server, it's only loaded once, and it should keep track of all the classes that get loaded, and only load them once (unless the file changes, say). Static variables should apply to the server scope (classloader). The way it stands right now, if all the classes are essential unloaded after each request, then we're still really close to the CGI paradigm. If I have 10,000 users who each use 10 pages per session, why do I need to load the "Foo" class 100,000 times?
Zend guys, what are your thoughts? Was this concept considered and rejected? Your thought process and direction are important to my technology choice.
PHP is pretty much a stateless language. If you want to keep a state you're going to have to serialize/unserialize to your harddisk or DB. There have been attempts at creating something similar to an app server such as srm but they never really took off. In any case, "app server" is quite a general concept and I could argue that Apache & PHP together are an App Server.
Anyway, if you really need to persist data/variables across requests, there are ways to do it (if it's per-Apache process it's even easier) but not quite as simple as leaving an object floating around in main memory between requests.
Andi
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php