How to use an Anonymous Function in PHP