About This Course

Learn what to expect from this course and its intended audience.

This course has been created for intermediate to advanced developers with PHP expertise. Those who want to learn about the functional programming style can benefit from the contents of this course.

Prerequisites

To fully benefit from the course, knowledge of the following programming concepts is required:

  • Variables and how to assign values to them
  • Control structures like if, else, foreach, and for
  • Strings and string concatenation (using .)
  • Integers
  • Expressions and comparisons (<, and >, for example)
  • Associative arraysArrays with string keys and values. and indexed arraysArrays where only the values are relevant.

What’s in the course

Each chapter covers a separate aspect of functional programming in some meaningful way. The course should be followed in order, using the code examples as they’re presented.

Below is a brief overview of the contents of each chapter in the course:

  • An Introduction to Functional Programming in PHP: This chapter provides a brief history of PHP, a definition of functional programming, an explanation of the perks on offer, and its relevance to a PHP developer.

  • Core Concepts: Functional Programming in PHP: This chapter focuses on the idea of writing pure functions, immutability as a concept, and grading functions based on referential transparency.

  • Composition and Helper Functions: This chapter serves as a detailed exploration of function composition. It also provides commentary on transducers and the map, filter, and fold operations for manipulating list data. Finally, it discusses helper functions, whose utility is their conceptual abstraction.

  • Error Handling in Functional Programming: This chapter showcases the weaknesses of PHP exceptions and highlights the pros and cons of alternative-flow control mechanisms like default values, callbacks, and error messages. Furthermore, the chapter demonstrates the use of Sum types, like Either and Maybe, as additional alternatives to exceptions.
  • Functors in PHP: This chapter focuses on the Functor construct. It offers an insight into Category Theory, demonstrates how to roll out functors in PHP, and explains monads of various kinds, such as IO, State, Reader, and List.
  • Parallelization of tasks in PHP: This chapter offers insights into achieving concurrency through task parallelization in PHP using RabbitMQ, PCNTL routines, and the PECL pthreads extension.

  • Recursion, Pattern Matching, and Property Testing: This chapter explains the concepts mentioned in the chapter title as additional techniques worth using in PHP.

  • Phonebook Application — A Simple Project: This chapter is a walkthrough on how to create a simple console phonebook application in the functional programming style.

This course contains well-explained topics and allows us to implement them on the spot. We’ll also tackle some quizzes and coding challenges to further consolidate the concepts. The goal is to enable us to develop PHP applications using what we’ve learned in the course.