This steps was only helpful while implementing the algorithm. And could be useful while comparing with the W3C specification, but they take up too much space.
Unfortunately array_map only accepts arrays. Foreach looks more understandable (and performant) this way.