compatibility fix: PHP 5.3, self in anonymous functions