Make PHP 5.2 compatible

This fixes #28.

The incompatible things that I've changed are anonymous functions, `__DIR__` and late static binding.