12
votes
1answer
686 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; } } ...
10
votes
2answers
2k views

Static is bad, but what about the Factory pattern?

I'm on a TDD project, so I try to stick as much as possible to the good pratices involved with that kind of development. One of them is avoiding as much as possible static and global. I'm facing this ...