Knowledge baseExam Center
ENEnglish
Choose language13

Learn PHP — Advanced

Build reports and object collections in PHP, combining validation, sorting and calculations. Learn inheritance, magic methods, typing, iterators, generators, regular expressions, and exception handling and testing.

COURSE OVERVIEWREADY
Lessons: 83
Quizzes: 14
All steps: 97
$Ready to start
Knowledge base for this technology

What you will learn

  • Design classes, collections and validation rules, and use inheritance, interfaces and magic methods.
  • Process and report data through mapping, filtering, grouping, sorting, summation and transformation chains.
  • Create custom iterators and lazy generator pipelines, and use SPL structures, references and object cloning.
  • Use regular expressions, strict comparisons and typing, and throw, catch and test exceptions while preserving cleanup in finally.

Course curriculum

Work through the curriculum step by step. Completed stages are marked, and you can open the next available stage.

83 lessons14 quizzes97 steps total
  1. 01LESSON
    LESSON 1: Anonymous functions — creating them (function)Available now
  2. 02LESSON
    LESSON 2: Anonymous functions as an argument (array_map)Locked
  3. 03LESSON
    LESSON 3: Anonymous functions in array_filterLocked
  4. 04LESSON
    LESSON 4: Closures (use)Locked
  5. 05LESSON
    LESSON 5: Arrow functions (fn)Locked
  6. 06LESSON
    LESSON 6: Variable functions — you will call a function by a name held in a variableLocked
  7. 01QUIZ
    Quiz 1: lessons 1–6Locked
  8. 07LESSON
    LESSON 7: A function returning a functionLocked
  9. 08LESSON
    LESSON 8: Variable arguments – func_get_argsLocked
  10. 09LESSON
    LESSON 9: Variadic arguments – ...$argsLocked
  11. 10LESSON
    LESSON 10: Recursion: Fibonacci — you will compute the successive values of a sequence recursivelyLocked
  12. 11LESSON
    LESSON 11: Recursion: summing multidimensional arraysLocked
  13. 12LESSON
    LESSON 12: Multidimensional arrays – creation and accessLocked
  14. 02QUIZ
    Quiz 2: lessons 7–12Locked
  15. 13LESSON
    LESSON 13: array_map on an array of arraysLocked
  16. 14LESSON
    LESSON 14: array_filter on an array of arrays — rejecting by a nested predicateLocked
  17. 15LESSON
    LESSON 15: array_reduce on an array of arrays — you will reduce a structure to a single value/setLocked
  18. 16LESSON
    LESSON 16: Sorting an array of arrays by key (usort)Locked
  19. 17LESSON
    LESSON 17: Sorting by a nested value (custom comparator)Locked
  20. 18LESSON
    LESSON 18: Multi-level associative arrays — you will organize data in dictionaries within dictionariesLocked
  21. 03QUIZ
    Quiz 3: lessons 13–18Locked
  22. 19LESSON
    LESSON 19: References in arrays and passing by referenceLocked
  23. 20LESSON
    LESSON 20: By value vs by reference — you will compare the costs and the semantic effectsLocked
  24. 21LESSON
    LESSON 21: Destructuring – list()Locked
  25. 22LESSON
    LESSON 22: Destructuring – short []Locked
  26. 23LESSON
    LESSON 23: Spread operator for arrays (...)Locked
  27. 24LESSON
    LESSON 24: Merging arrays with spreadLocked
  28. 04QUIZ
    Quiz 4: lessons 19–24Locked
  29. 25LESSON
    LESSON 25: OOP: creating a class and an objectLocked
  30. 26LESSON
    LESSON 26: OOP: properties and methods — you will add fields and behaviors to a classLocked
  31. 27LESSON
    LESSON 27: OOP: constructor and destructor — you will initialize state and clean up resourcesLocked
  32. 28LESSON
    LESSON 28: Visibility: public — you will expose a class's public APILocked
  33. 29LESSON
    LESSON 29: Visibility: private — you will hide implementation detailsLocked
  34. 30LESSON
    LESSON 30: Visibility: protected — you will prepare classes for inheritanceLocked
  35. 05QUIZ
    Quiz 5: lessons 25–30Locked
  36. 31LESSON
    LESSON 31: Inheritance (extends) — you will build a child classLocked
  37. 32LESSON
    LESSON 32: Method overriding — you will change the behavior of an inherited methodLocked
  38. 33LESSON
    LESSON 33: Polymorphism — you will call the same method on different objectsLocked
  39. 34LESSON
    LESSON 34: Domain collection (e.g. BookCollection) — you will design a class that wraps an array of objectsLocked
  40. 35LESSON
    LESSON 35: Interfaces – interface and implements — we define a contract and its implementationLocked
  41. 36LESSON
    LESSON 36: Multiple interfaces — you will combine several contracts in one classLocked
  42. 06QUIZ
    Quiz 6: lessons 31–36Locked
  43. 37LESSON
    LESSON 37: Trait – sharing codeLocked
  44. 38LESSON
    LESSON 38: Namespace – creating and usingLocked
  45. 39LESSON
    LESSON 39: Class aliasing (use) — you will shorten fully qualified namesLocked
  46. 40LESSON
    LESSON 40: Magic: __get — you will intercept reads of nonexistent propertiesLocked
  47. 41LESSON
    LESSON 41: Magic: __set — controlling the setting of propertiesLocked
  48. 42LESSON
    LESSON 42: Magic: __call — you will handle calls to nonexistent methodsLocked
  49. 07QUIZ
    Quiz 7: lessons 37–42Locked
  50. 43LESSON
    LESSON 43: Magic: __callStatic — the equivalent for static methodsLocked
  51. 44LESSON
    LESSON 44: Magic: __toString — you will turn an object into a stringLocked
  52. 45LESSON
    LESSON 45: Magic: __invoke — an object callable like a functionLocked
  53. 46LESSON
    LESSON 46: Magic: __isset and __unset — you will react to checking and removing propertiesLocked
  54. 47LESSON
    LESSON 47: Argument typing — you will enforce parameter types of functions/methodsLocked
  55. 48LESSON
    LESSON 48: Return typing — you will declare the type of the returned valueLocked
  56. 08QUIZ
    Quiz 8: lessons 43–48Locked
  57. 49LESSON
    LESSON 49: Union types (PHP 8+) — you will allow multiple types in one declarationLocked
  58. 50LESSON
    LESSON 50: The nullsafe operator (?->) — you will safely traverse a chain of callsLocked
  59. 51LESSON
    LESSON 51: Null coalescing (??) — you will set sensible default valuesLocked
  60. 52LESSON
    LESSON 52: match instead of switch (PHP 8+)Locked
  61. 53LESSON
    LESSON 53: declare(strict_types=1) — you will enable strict type checking in a fileLocked
  62. 54LESSON
    LESSON 54: Your own my_filter — a higher-order filter with a callbackLocked
  63. 09QUIZ
    Quiz 9: lessons 49–54Locked
  64. 55LESSON
    LESSON 55: Custom my_map — Mapping Elements While Keeping Functions PureLocked
  65. 56LESSON
    LESSON 56: Custom my_reduce — Reduce a Collection to a Single Value with Your Own ImplementationLocked
  66. 57LESSON
    LESSON 57: compose – Combining FunctionsLocked
  67. 58LESSON
    LESSON 58: pipe – Passing the Result AlongLocked
  68. 59LESSON
    LESSON 59: Generator: yield and return — you will create a generator with a termination conditionLocked
  69. 60LESSON
    LESSON 60: Generator for a multidimensional array — you will traverse nested structures lazilyLocked
  70. 10QUIZ
    Quiz 10: lessons 55–60Locked
  71. 61LESSON
    LESSON 61: A custom iterator in PHPLocked
  72. 62LESSON
    LESSON 62: A custom aggregate (IteratorAggregate) in PHPLocked
  73. 63LESSON
    LESSON 63: Using foreach on a custom iteratorLocked
  74. 64LESSON
    LESSON 64: SPL: SplStack (stack) — you will use the LIFO structure in practiceLocked
  75. 65LESSON
    LESSON 65: SPL: SplQueue (queue) — you will implement FIFO with a ready-made classLocked
  76. 66LESSON
    LESSON 66: SPL: SplFixedArray — you will optimize a fixed-size arrayLocked
  77. 11QUIZ
    Quiz 11: lessons 61–66Locked
  78. 67LESSON
    LESSON 67: Creating a Custom Exception in PHPLocked
  79. 68LESSON
    LESSON 68: Throwing and Catching a Custom ExceptionLocked
  80. 69LESSON
    LESSON 69: Nested try-catch in PHPLocked
  81. 70LESSON
    LESSON 70: finally – Cleanup Regardless of the OutcomeLocked
  82. 71LESSON
    LESSON 71: Regex: preg_match — you will match a pattern against textLocked
  83. 72LESSON
    LESSON 72: Regex: preg_replace — you will replace parts of text based on a patternLocked
  84. 12QUIZ
    Quiz 12: lessons 67–72Locked
  85. 73LESSON
    LESSON 73: Regex: preg_replace_callback — function-driven text replacementLocked
  86. 74LESSON
    LESSON 74: Tests: a simple assert — a mini-infrastructure without a frameworkLocked
  87. 75LESSON
    LESSON 75: Exception tests — you will verify that code throws the expected errorsLocked
  88. 76LESSON
    LESSON 76: Refactoring: many ifs → matchLocked
  89. 77LESSON
    LESSON 77: Refactoring: extracting functions from procedural codeLocked
  90. 78LESSON
    LESSON 78: Short-circuit evaluation (&&, ||) — shortening evaluation in validationsLocked
  91. 13QUIZ
    Quiz 13: lessons 73–78Locked
  92. 79LESSON
    LESSON 79: Lazy evaluation with a generator — processing a stream “on demand”Locked
  93. 80LESSON
    LESSON 80: References and copying – objects vs arraysLocked
  94. 81LESSON
    LESSON 81: Expressions and statements — values and controlling the program flowLocked
  95. 82LESSON
    LESSON 82: Task: a to-do list with OOP, exceptions, and filtersLocked
  96. 83LESSON
    LESSON 83: Final task: a transformation chain on an array of objectsLocked
  97. 14QUIZ
    Quiz 14: lessons 79–83Locked
  98. +EXAM
    Confirm your skills with an examPreparing with this course is optional. You can choose a certification exam for this language and level without completing the course or quizzes. Check your account access and confirm exam authorization.Other status