Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Programming languages

PHP (8.5)

Modern PHP 8.5 from a first script to secure web apps: types, arrays, strings, objects, errors, Composer, PDO, testing, upgrades and WordPress code.

9 lessons to read 3 modules

9 lessons: 5 free with Pro answers and 4 with a free core.

Examples run with PHP 8.5.11.

Who it is for

Web developers maintaining PHP and WordPress sites, and freelancers.

What you will be able to do

  • Install PHP 8.5, run scripts from the command line and a local web server, and read every warning and error PHP prints
  • Write programs with PHP's values, comparisons, control flow, functions and type declarations
  • Store and transform data with arrays, strings, regular expressions, JSON and dates
  • Model data with classes, interfaces, traits, enums, readonly properties and property hooks
  • Handle errors with exceptions and logs, and organise a project with namespaces and Composer
  • Handle requests, forms, cookies and sessions, and escape output so pages are safe
  • Query MySQL, PostgreSQL and SQLite safely with PDO, prepared statements and transactions
  • Test code with PHPUnit and Pest, and check it with static analysis and coding standards
  • Upgrade legacy code to PHP 8.5 and maintain the PHP side of WordPress sites
  • Deploy, monitor and hand over PHP applications behind PHP-FPM

Revise and practise

Modules and lessons

What the labels mean

Free lesson, Pro answers
the whole lesson is free; the model answers to its interview questions open with a pass
Free core, Pro depth
the core of the lesson is free; its in-depth parts open with a pass
Pro
opens with a Pro, Premium or Ultimate pass

Minutes are reading time: “6 of 15 min free” means 6 minutes of the lesson are free.

What a pass opens in this track

10 in-depth parts and 22 interview answers. The same pass opens every other track and every Pro tool.

  1. Module 1

    Start here: PHP in 2026

    What PHP is and where it runs, which branches still receive security fixes, installing PHP 8.5, and a first script with the error messages PHP prints.

    1. What PHP is and where it runs in 2026 Beginner Free lesson, Pro answers: 15 minutes
    2. Install PHP 8.5 and check your setup Beginner Free lesson, Pro answers: 10 minutes
    3. Your first PHP script, the CLI and error messages Beginner Free lesson, Pro answers: 15 minutes
  2. Module 2

    Values, variables and types

    Variables and constants, integers and floats with safe money maths, strings and heredoc, booleans and null, and how == and === compare values.

    1. Variables, constants and printing values Beginner Free lesson, Pro answers: 10 minutes
    2. Strings: quotes, escapes, interpolation and heredoc Beginner Free core, Pro depth: 6 of 15 minutes free
    3. Booleans, null and which values count as false Beginner Free core, Pro depth: 4 of 10 minutes free
  3. Module 3

    Control flow

    if, else and the ternary operator, switch and match, the four loops, and splitting a program into files with include and require.

    1. if, else, elseif and the ternary operator Beginner Free lesson, Pro answers: 15 minutes
    2. Loops: for, while, do-while and foreach Beginner Free core, Pro depth: 6 of 20 minutes free
    3. include and require: splitting code into files Beginner Free core, Pro depth: 7 of 20 minutes free

Related tools

Official documentation

More in Programming languages

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.