Backend development

Stage 1 · Lesson 3 of 10

Arrays, functions and classes

Your language and how HTTP works

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

  • VideoFree
    PHP For Beginners

    Laracasts · Beginner

    Free video series that builds a small app in plain PHP before any framework

  • GuideFree
    PHP: The Right Way

    Josh Lockhart and contributors · Intermediate

    Modern PHP practice in one place: Composer, PSR standards, PDO and security basics

Practise

  • Your language track: small exercises with free mentor feedback on idiomatic code

Keep handy

  • Quick syntax lookups for your language when you forget how something is written

  • Read the HTTP overview, methods, headers and status code pages until they feel obvious

Also worth your time

Mark this stage as not done?