Q:

How to use anonymous functions before PHP 5.3?

I have a class that uses 5.3 feature anonymous function (https://github.com/JeffreyWay/Easy-WordPress-Custom-Post-Types/blob/master/jw_custom_posts.php), but there is a problem, on the server I can not upgrade to 5.3. Is there any simple workaround to get rid of anonymous functions or do I need to rewrite whole class?

A:

You have two options:

Change the hosting with PHP version supporting anonymous functions
Re-write your code so it works with version of PHP you have

