I have a fairly basic PHP question that I don't seem to be able to find an answer to. When a user visits a website that executes a PHP script, is that script run in isolation from all other running instances of the same script?

For example, if I have a class with a static variable (which means that variable is basically shared across all instance of that class) will each visiting user to the website have their own copy of the static variable or will all users have the same static variable?

Thanks.

有帮助吗?

解决方案

There doesn't exist some method share the variables, besides from using shmop functions.

It is a full isolation. (Every request starts a new interpreter session)

其他提示

Each user will have their own variable, it is only shared per request

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top