Advent of Functional PHP: Review

Submitted by Larry on 29 December 2021 - 7:10pm

Over the last few weeks, I've been following Advent of Code 2021, using Functional PHP as an approach. It's been a fun and educational process, at least for me and apparently for a few other people, at least given how popular the articles have been.

For reference, the full list of articles in this series is here:

  1. Day 1: Function composition, pipes, and partial application.
  2. Day 2: Map, reduce, generators, immutable objects, and with-er methods.
  3. Day 3: Recursion, memoization, and bits.
  4. Day 4: First, head, array flattening, and handling state.
  5. Day 5: Zip and nested pipes.
  6. Day 6: Efficiency and dealing with infinite streams.
  7. Day 7: Functional means and medians
  8. Day 8: Encoding, decoding, and the value of first-class function thinking.
  9. Day 9: More fun with recursion.
  10. Day 10: Reduction and recursion, and how to swap between them.

After letting those sit for a few days, I want to use those examples as a way to evaluate how well PHP handles functional-style programming and what improvements we could make to the language to make it even better.

Continue reading this post on PeakD.