Domanda

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.

È stato utile?

Soluzione

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)

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top