Functional Programming in PHP, 2nd Edition
Write Concise, Maintainable, and Easier-to-test Code
Many languages have embraced Functional Programming paradigms to augment the tools available for programmers to solve problems. It facilitates writing code which is easier to understand, easier to test, and able to take advantage of parallelization. Functional Programming is a good fit for building modern, scalable solutions.
PHP introduced anonymous function and closures in 5.3, providing a more succinct way to tackle common problems. More recent releases have added generators and variadics which can help write more concise, functional code. However, making the mental leap from programming in the more common imperative style requires understanding how and when to best use lambdas, closures, recursion, and more. It also requires learning to think of data in terms of collections for mapping, reducing, flattening, and filtering.
Functional Programming in PHP will show you how to leverage these new language features by understanding functional programming principles. With over twice as much content as its predecessor, this second edition expands upon its predecessor with updated code examples and coverage of advances in PHP 7 and Hack. Each chapter provides plenty of examples to illustrate each concept as it’s introduced and to show how to implement it with PHP. You’ll learn how to use map/reduce, currying, composition, and more. Finally, the book reviews the available external libraries and looks at new language features proposed for extending PHP’s functional programming capabilities.
The sample includes the Table of Contents and Index.
Functional Programming in PHP Contents
This book covers the following topics in depth:
- History and Benefits of Functional Programming
- Language features including Types, Functions, Namespacing
- Using Recursion, Map, Reduce, and Filtering.
- How to use Memoization and Generators
- Helpful 3rd Party Libraries
- Functional Programming in HHVM’s Hack
- Functional Patterns including Composition, Partial Functions, and Pipelines
- Explanation of Pattern Matching, Functors, Applicatives, Monads, and Currying
- Implementation Examples
- Event Drive Programming
What others are saying
— assertchris (@assertchris) March 28, 2017
About the Author
- Functional Programming in PHP, 2nd Edition
- Digital Formats
- PDF, ePub, Mobi
- Simon Holywell
- Date Published
- 7.5" x 9.2"