My testing program is found on the following pastebin: http://pastebin.com/iDJiQcFw This test shows the time results between recursive sanitizing between a foreach loop, array_map, and array_walk. Here are my results: Conclusion: The lead is array_walk, then foreach, then array_map. The cause of array_walk being the lead on this may be due to the use of references, rather than assigning a new instance to each variable.