0

Hi,

I am php noob and I have question about the singleton patter in php. I am not sure how the server handles the different users. If I create a singleton class, is that "single" instance shared among all the different users connecting to the server? are there any situations in which one users can change the value of a variable being used by another user?

Thank you in advance.

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by griswolf
0

anyone?

Hi,

I am php noob and I have question about the singleton patter in php. I am not sure how the server handles the different users. If I create a singleton class, is that "single" instance shared among all the different users connecting to the server? are there any situations in which one users can change the value of a variable being used by another user?

Thank you in advance.

0

If I create a singleton class, is that "single" instance shared among all the different users connecting to the server?

You are conflating PHP and web service. They are distinct. Depending on how you have set up your server, it may share the running service among all connections or each connection may have (effectively) its own copy of the code. Nothing directly to do with PHP. By default, connections are distinct (otherwise, chaos is too likely to ensue)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.