Stage 1 · Lesson 2 of 10
Modern PHP syntax and types
Learn PHP 8, not the PHP of old tutorials. Start every file with declare(strict_types=1);. Then a function typed to take an int rejects the string "5", instead of quietly converting it.
Learn typed parameters, return types and properties, and union and nullable types such as ?string (a string or null). Learn , match expressions, (a fixed list of allowed values) and readonly properties. property promotion is worth learning too: it declares and sets properties right in the constructor's signature. Run scripts with php from the terminal.
Common traploose comparison: == converts types before comparing and has surprised PHP developers for years, so use === by default and let strict types catch mistakes early.
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