Anonymous function rewritten as static one to maintain compatibility with PHP 5.2

Fixes #292