PHP Magic Functions: Best Part of Object Oriented PHP – Part 2

In my previous post ( PHP Magic Functions ), I discussed about __construct, __destruct, __call and __callStatic. Lets explore a few more magic functions …

__set and __get : Define Object Data Members at Run Time

In PHP what happens when you try to write data to an undefined object data member. PHP doesn’t throw any error or warning or exception. You can easily write and access that data member in your code. For e.g.

 
Scroll to Top