Possible duplicate:
When do/should I use __construct(), __get(), __set(), and __call() in PHP?
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?
Possible duplicate:
When do/should I use __construct(), __get(), __set(), and __call() in PHP?
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?
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.