Coming from strongly typed languages, I'm uncomfortable with the magic getter and setter methods of PHP. What is the motivation behind implementing them into the language and what are the general recommendations regarding using them?
Edit:
I understand the motivation behind using getters and setters in general. I'm interested in the motivation behind using magic getter and setter methods (as opposed to setProperty($property)
and getProperty()
methods).