Tagged: object oriented programming

Late static binding workaround prior to PHP 5.3

A workaround for binding to the intended static scope without using the static:: operator introduced in PHP 5.3. The Issue When calling a parent method, we often want dynamic binding to occur so that any method calls and member references made in this parent method will be looked up starting in the true class of the object being invoked and then in the inheritance tree.… Read the rest

Code Commenting – a delicate art of balance

Taken from my reply to a post regarding the topic on Facebook, a few words introducing key guidelines I follow when commenting my code. Regarding classes, I like to provide a class summary stating the intent and purpose. Accessors, Mutators, Constructors – I don’t feel the need to comment them as their roles are (and should be) rather self-explanatory.… Read the rest