Welcome
![]() | ![]() |
Introduction to the [PHP 8] language by example
created by Anthropic’s AI Claude at the request of Serge Tahé - October 2026
This course teaches the PHP 8 language by example: console scripts, all commented line by line with their results reproduced, then web services and a web application. It is the PHP 8.5 rewrite of the course Introduction to the PHP 7 Language by Example (2019): none of its scripts uses a deprecated feature.
After setting up the working environment (Laragon, PHP 8.5, VS Code, Composer), it presents the basics of the language (types and strict typing, arrays, strings, functions, files, JSON), classes (typed properties, readonly, enumerations, property hooks), interfaces, exceptions, traits, layered applications and their tests with PHPUnit; then the MySQL and PostgreSQL databases with PDO, network functions (TCP, HTTP, SMTP, POP3, IMAP), web services (JSON, sessions, authentication, HTTPS) and XML document processing.
A common thread runs through the whole course: the calculation of French income tax, built in 13 versions, from a simple script up to an MVC web application answering in JSON, XML or HTML, with its console client, its tests, a Redis cache and e-mails sent to the administrator.
Prerequisite: having already programmed in some language.

