Fix compatibility with PHP53

Fix a PHP 5.3 incompatibility introduced in PR #444 related to scope of $this in closures.