Jump to content

Academic Question RE: Singletons


rwilkerson

Recommended Posts

I'm working on my first PHP application in...years, and I just created a few singletons.  I didn't think too much about it since I understand static members and the like, but in the course of doing some reading I bumped into a very basic question...

 

Since the internet is a stateless environment, what mechanism does PHP use to "persist" the object instantiation across requests?  In other words, how does PHP know that a class has already been instantiated 3 or 4 requests after the instantiation occurred?

 

The question seems fairly academic at the moment (my singletons seem to be working as expected), but a deeper understanding can never be bad...can it?

 

Any insight would be appreciated.

 

Rob Wilkerson

Link to comment
https://forums.phpfreaks.com/topic/70742-academic-question-re-singletons/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.