replacing closure with create_function for php5.2