Skip to content

Instantly share code, notes, and snippets.

View alexlvcom's full-sized avatar

Alexander alexlvcom

View GitHub Profile
@mindplay-dk
mindplay-dk / collections.md
Last active June 6, 2021 14:37
Linear collection workflow

You can have a linear workflow with the array functions.

The following is unreadable:

$output = array_reduce(
  array_map(
    function($n) { return $n ** 2; }
    array_filter($input, function($n) { return $n % 2 == 0; })
 ),