سؤال

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