my.indeed - Create Account - Sign in
 

PHP Singleton scope

Get new comments by email
You can cancel email alerts at anytime.
Comments (2)

Shmulik in Kefar Habad, Israel

11 months ago

Hi,
Might be a stupid question, but I really do not understand.
When creating a singleton pattern class,
it seems to me that on every request to the page, the instance should be recreated,
and I've expected that once I've used the singleton pattern and already created an instance of the class, this instance will be available for me through all pages / users requests.
Please explain me, what exactly I am missing here.

Thanks,
Shmulik

Was this comment helpful? Yes / No Reply - Report abuse

someone in Hemel Hempstead, United Kingdom

2 months ago

are you taking the piss? i don't think you should be a programmer.

Was this comment helpful? Yes / No Reply - Report abuse

Your Reply

change location - create a profile
Your Name
 in Santa Monica, California
Your Comment
Your Email Address
Enter the numbers you see in the box
CAPTCHA Image

Be Reasonable! Be Polite! Please read our Terms of Service and Forum Rules, where it notes that you are responsible for your own comments. You may post anonymously - but we reserve the right to remove inappropriate comments at any time.

RSS Feed Icon Subscribe to this discussion as an RSS feed.