PHP 8.4 & 8.5 — Hands-on Workshop May 7, 2026

Welcome! Tonight we're going to play with four of the tastiest new features from PHP 8.4 and 8.5, split across four exercises.

Structure: short intro → you try it → we move on. No prior 8.4/8.5 knowledge required — if you've written a class in PHP, you're ready.

The deal: pair up if you like, break things on purpose, ask weird questions. The person next to you probably has the answer.

🚀 Get your environment ready (pick one)

You need a way to run PHP 8.5. Easiest options first.

2. Docker one-liner

One terminal, no install polluting your system:

docker run --rm -it -v "$PWD":/app -w /app \
  php:8.5-cli php hero.php

Or an interactive REPL:

docker run --rm -it php:8.5-cli php -a

3. DDEV (if you already use it)

Edit .ddev/config.yaml:

php_version: "8.5"

Then ddev restart and ddev php hero.php.

4. Local install

macOS: brew install php@8.5
Linux (Ubuntu): sudo add-apt-repository ppa:ondrej/php then sudo apt install php8.5-cli
Windows: WSL + the Docker option, or grab the binary from windows.php.net.

Sanity check: run php -v and make sure you see PHP 8.5.x. If you see 8.4, most of exercise 1 will work but exercise 2 and 3 will not.

📋 Exercises


📚 Going further

Copied to clipboard!