Revert for older version of PHP

Current PHP version does not support anonymous functions.