This is a performance critical section .. coding standards should apply to standard section ... this module is taking a lot of time to execute and is not working on shared hosting .. 

I think coding standards should be bypassed for the sake of critical performance issues

please reconsider

What is the issue in specific? Can I rewrite using array walk and a normal function (avoiding lambda?) 

I think that adding a comment that explains better the cryptics in this code should "rejoin" the stadndard ..