The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
2answers
2k views

Static variable - Usage and Implications on Threading

I have some confusion regarding the use of static variables/references in a class. It feels like I may not have entirely figured out the implications of keeping something static. When I say a ...
2
votes
3answers
2k views

OO PHP static keyword, should I use it?

I'm writing script for fb and I have 3 objects that I'll be using through all classes. I'm wondering if there is any advantage in using the static keyword except I don't have to create an instance ...
8
votes
3answers
5k views

Understanding the static keyword

I have some experience in developing with Java, Javascript and PHP. I am reading Microsoft Visual C# 2010 Step by Step which I feel it is a very good book on introducing you to the C# language. I ...
65
votes
9answers
18k views

Don't Use “Static” in C#?

I submitted an application I wrote to some other architects for code review. One of them almost immediately wrote me back and said "Don't use "static". You can't write automated tests with static ...
12
votes
1answer
780 views

Why is there no facility to overload static properties in PHP?

Intro PHP allows you to overload method calls and property accesses by declaring magic methods in classes. This enables code such as: class Foo { public function __get($name) { return 42; } } ...
26
votes
4answers
30k views

Why and when should I make a class 'static'? What is the purpose of 'static' keyword on classes?

The static keyword on a member in many languages mean that you shouldn't create an instance of that class to be able to have access to that member. However, I don't see any justification to make an ...