After a long time, I took some time off to understand OOP in PHP, a language that was very familiar to me. Doing it in PHP was more fun than doing it in C++ (which i've done more than a dozen dozen times) even though my current language of choice would be Ruby or Clojure :)
I learnt the following
- Late static bindings is "over-riding for static functions"
- Define and use __autoload() to autoload class defs.
- The final keyword in php isn't same as the final in java. (final in java is const in php)
- Const methods and props are refered to in the same class using the self:: and not $this-> (The later is for non-const props and methods).
- $this is not available to static props and methods. Static props cannot be used on objects but only on class.
- Interfaces can be extended
- Type Hinting is awesome. Allows forcing PHP to work like a strictly-typed language.
One thing that I've always liked about PHP is that the docs are awesome and it's more awesome coz of the user comments on every doc page.