You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IMHO at least for array_map there is no defined order in which the callback function should be called (although the implementation uses the canonical order). From a language design perspective, this is a good thing, because then you can potentially parallelize execution.
What about instead implementing a function that enumerates an array (inspired by Python)? This would force canonical keys or wrap elements as ['loop0' => $index, 'value' => $element]:
I really like that twig have a
loop
variable in its for loops.It would be great to also have then in a loop with the the
map
filter. For example:https://twigfiddle.com/4ntrof
The text was updated successfully, but these errors were encountered: