PHP notes
Notes on doing different things within the PHP language.
Object oriented introspection
- property_exists(obj,prop_name)
- method_exists(obj,method_name)
- is_a(obj,'clas_name') or ($obj instanceof ClassName)
Dynamic coding
- Call a method: call_user_func(array($obj,'method',...args...)
- You can simply $obj->prop = value to add properties.
- or you can use __set and __get. See http://php.net/manual/en/language.oop5.overloading.php