views:

195

answers:

1

Duplicate:

When do/should I use __construct(), __get(), __set(), and __call() in PHP?

Well, the title says it all. This is one area that I have not found any good answer. Can anyone explain to me why/how to use them correctly? Aren't they just a bad design decision?

+1  A: 

I think the documentation explains it best. And it's called Overloading.

__set() is run when writing data to inaccessible members.

__get() is utilized for reading data from inaccessible members.

It also has some examples of using these.

Ólafur Waage