Stage 1 · Lesson 3 of 10
Arrays, functions and classes
PHP has one flexible , the array. It works as a list, a map of keys to values, or both at once, with string or number keys. Learn array_map, array_filter, array_column and usort.
Remember that an array is copied when you pass it to a function, while an object is passed by handle, so the function works on the same object. Functions include like fn($o) => $o->total. They also include closures, which capture outside variables with use.
Classes bring interfaces, , and static methods, and uses all of them heavily.
Common trapbuilding everything from nested arrays with string keys. A typo like $order['totl'] only raises a warning and gives you null. A small class with typed properties fails loudly and tells your editor what exists.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- VideoFreePHP For Beginners
Laracasts · Beginner
Free video series that builds a small app in plain PHP before any framework
- GuideFreePHP: The Right Way
Josh Lockhart and contributors · Intermediate
Modern PHP practice in one place: Composer, PSR standards, PDO and security basics
Practise
Keep handy
Also worth your time
The DNS, TCP, TLS and HTTP steps behind every request your backend will handle