Scope of Static Members in PHP and Concurrency

I have a class that is declared in my application that has a private static member like so:

class SomeClass{
private static myMember =  array(); 

public static getterFunction(){}
public static setterFunction(){}


My question / concern is that multiple requests (i’m thinking like a thread in Java) would be able to modify this static member. My understanding of php scope and static members is that they are in the request scope and a new variable is created for each new request and subsequently destroyed after the request has been fulfilled. That said, this would be a difficult thing to test (at least i can’t think of an easy way) so i’d rather be safe than sorry.

Is my assessment correct? The PHP docs i’ve read are pretty crappy in terms of detail so I haven’t been able to authoritatively answer yet…

Leave a Reply


Hire Me
Follow Me!
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.