How to Detect and Fix PHP Memory Leaks
Last updated: 5 November 2026. See the update log at the end.In a normal PHP-FPM request,...
Roadmap
A clear path from your first line of PHP to writing modern, secure, object-oriented code, ready for a framework like Laravel. Tick off each step as you learn it.
Next: · Progress can't be saved in this browser (private mode?)
Understand what PHP does and run it on your own computer.
Browsers, servers, URLs and HTTP: PHP runs on the server and sends HTML back to the browser.
Use XAMPP or Laragon on Windows, Herd on macOS, or PHP from your package manager on Linux.
VS Code with a PHP extension (Intelephense) or PhpStorm. Learn to open a folder and use the terminal.
Echo "Hello", mix PHP with HTML, and run a script from the command line with php file.php.
The building blocks of every PHP program.
Strings, integers, floats, booleans, null, and how PHP converts between them.
if / else, match, comparisons (== vs ===), and loops: for, foreach and while.
Indexed and associative arrays, nested arrays, and functions like array_map, array_filter and sort.
Parameters, return values, default values, type hints, and variable scope.
Concatenation, string functions, sprintf, and dates with DateTime.
Read form input, validate it, and show errors. Never trust input from the browser.
Split pages into reusable files: header, footer and functions.
Store data, remember users and talk to other services.
Create tables, INSERT, SELECT with WHERE and JOIN, UPDATE and DELETE.
Connect to the database with PDO and always use prepared statements to stop SQL injection.
Keep users logged in between pages, and know the difference between a session and a cookie.
Read and write files, handle uploads safely (check type and size, never trust the name).
json_encode / json_decode, and calling REST APIs with cURL or Guzzle.
How professional PHP is written today.
Properties, methods, constructors, visibility, static members and constructor promotion.
Design code that is easy to extend and test. Learn the difference between the three.
Organise classes in namespaces and let PSR-4 autoloading find them, no more require lists.
Install and update packages, and autoload your own classes.
try / catch / finally, custom exceptions, and reading error messages calmly.
match, enums, readonly properties, named arguments, the nullsafe operator and union types.
Type every parameter and return value, and turn on declare(strict_types=1) to catch bugs early.
Habits that make your code safe and easy to work on.
Escape output (XSS), prepared statements (SQL injection), CSRF tokens, and password_hash / password_verify.
Write code that looks like everyone else's, and let a formatter do it for you.
Step through code with breakpoints instead of var_dump everywhere.
Write tests for your functions and classes, and run them before every change.
Validate and search text with preg_match and preg_replace.
Put it together and pick your direction.
A to-do app or a small blog with login, a database and forms, with no framework, so you understand what frameworks do.
Laravel is the most popular PHP framework and the most asked for in jobs.
Practise the PHP questions employers ask, from types to OOP and security.
Ask the community. Mention the step you are on and what you tried.
Share this roadmap with someone who is starting out, and follow it together.
Yes. PHP is one of the easiest languages to start with: you can put a .php file on a server and see the result in your browser. Writing secure, well-structured PHP takes longer, which is what the later stages cover.
Most people learn the basics in 4 to 8 weeks and reach a junior level in 3 to 6 months with regular practice. Building small projects along the way is the fastest way to learn.
Yes. PHP runs a large share of websites, including WordPress, and frameworks like Laravel and Symfony are widely used for web apps and APIs. Modern PHP 8 is fast and has a strong type system.
For back-end web development, PHP is a great first language. You will need some JavaScript for the browser side anyway, so you can learn its basics alongside PHP.
Yes, in this browser. Ticked steps are stored on your device, without an account. Use the same browser to continue where you left off.
Last updated: 5 November 2026. See the update log at the end.In a normal PHP-FPM request,...
Most lists of "best AI coding prompts" are collections of clever wording. Wording is rarely the...
Laravel Herd is a local development environment for macOS and Windows that runs PHP and nginx...
We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.