It turned out that the idea of running them sequentially wasn't so good. I tested some more and the final result was that there is almost zero difference. Which means we should go ahead with the map_deep().

Here is a patch for the introduction of map_deep() and converting all older *_deep() functions to using it.

22300.4.diff​ changes the order of the parameters in map_deep() so they match array functions in PHP such as array_walk_recursive(). It also implements a tidied up version of the original tests for map_deep() from 22300-tests.diff​ in addition to the tests from 22300.test1.diff​, and improves docs.