A functional approach encourages code reuse, greatly simplifies testing, and results in code that is concise and easy to understand. This book will demonstrate how PHP can also be used as a functional language, letting you learn about various function techniques to write maintainable and readable code.
After a quick introduction to functional programming, we will dive right in with code examples so you can get the most of what you’ve just learned. We will go further with monads, memoization, and property-based testing. You will learn how to make use of modularity of function while writing functional PHP code.
Through the tips and best practices in this book, you’ll be able to do more with less code and reduce bugs in your applications. Not only will you be able to boost your performance, but you will also find out how to eliminate common loop problems. By the end of the book, you will know a wide variety of new techniques that you can use on any new or legacy codebase.
The first part is brilliant. The explanations are clear, the examples very good and the learning curve almost perfect. When getting into Monoids and Monads it becomes harder to follow, but still quite good.
The part about practical monads, especially Reader, Writer and Io monads, is disappointingly superficial, with barely any example and, as a result, very hard to understand.
I glanced over the Laravel/Symfony integration and completely ignored Wordpress/Drupal, and didn't go too deep into the testing part (it's mostly quite logical).
If it weren't for the monads chapters, it would have deserved 5 stars.
A very good introduction to functional programming in PHP and, in my case, to the world of functional programming. I will not say this book was an easy read, because functional programming itself is a complex topic, but I believe the author made a really good job at describing the principles about this paradigm and a way that it can be approached in the PHP language. A must-read for any programmer wanting to learn functional programming in PHP.