Closures, built-in functions and objects
Scope and closures, the string and array function toolbox, and the first classes.
About 4 hours of study
Learning objectives
- Understand scope and closures
- Use map, filter, reduce and sort
- Write classes and objects
Lessons
- 1
Scope and closures Intermediate
Local and global scope, static variables, closures with use, arrow functions and callbacks.
- 2
String and array functions Intermediate
Map, filter, reduce and sort with callbacks, and the most useful string and array functions combined.
- 3
Classes and objects Intermediate
Classes, objects, properties and methods, constructors, visibility, static members, constants and copying objects.
Module practice
- PHP: An id generatorEasy
- PHP: A multiplier factoryMedium
- PHP: A running calculatorHard
- PHP: Length of each wordEasy
- PHP: Sort words by lengthMedium
- PHP: Totals from CSV linesHard
- PHP: A counter classEasy
- PHP: A bank accountMedium
- PHP: A Fraction classHard