Getting rid of anonymous functions for php 5.2