Functional Programming with PHP

Functional Programming with PHP
Functional Programming with PHP
English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 2h 27m | 368 MB

Discover how to write more readable, maintainable PHP code by taking up functional programming. In this course, Shaun Wassell helps you get up and running with this popular programming paradigm. Shaun begins by covering fundamental concepts, including why functions and data are kept separate in functional programming and how to work with first-class functions in PHP. He then delves into the functional aspects of PHP, highlighting the built-in functions and features that allow you to work with arrays functionally, as well as filter, reduce, and sort lists of items. He also covers some more advanced concepts, such as recursion and partial application. To wrap up, Shaun shares code conversion challenges that allow you to put your new skills to the test.

Table of Contents

1 A functional approach to transform code
2 What you should know
3 Installing and running PHP
4 Why use functional programming
5 What is declarative programming
6 Immutability in functional programming
7 Separation of data and functions
8 First-class functions
9 Functions as data, part 1
10 Functions as data, part 2
11 Passing functions as arguments
12 Returning functions
13 Closure
14 Higher-order functions
15 Arrow functions in PHP
16 Working with arrays, functionally
17 The spread operator and array merge
18 Mapping
19 Filtering
20 Passing keys to array functions
21 Sorting
22 Custom sorting behavior with usort
23 Reducing
24 Combining array functions
25 Challenge Recreating the array map function
26 Solution Recreating the array map function
27 Advanced functional concepts
28 Partial application and currying
29 Recursion
30 Composition, part 1
31 Composition, part 2
32 Challenge Property getter
33 Solution Property getter
34 Challenge Tallying votes
35 Solution Tallying votes
36 Challenge Value or array
37 Solution Value or array
38 Next steps