Syntax Checkpoint

Syntax Checkpoint

Playground Checkpoint

Find and fix five mistakes in a broken file — no auto-grading, just a real attempt.

20–30 min

The Challenge

Friday afternoon. Marcus slides a file across to Mia: a copy of booking.php, cut down to a few lines. "I broke five things in here," he says. "Some stop PHP completely, one just prints the wrong thing. Find all five — without me."

Open the broken file in the PHP Playground with the button below. Fix it until it runs cleanly and prints exactly the expected output. For each mistake, note which rule from this Act it breaks.

What You Need to Fix

  • The file must run with no errors and no warnings at all.
  • Find and fix all five mistakes. For each one, write down which rule it breaks (for example: "missing semicolon — chapter 2").
  • Keep declare(strict_types=1); in the file — in the right place.
  • Rename any invalid name so it follows the naming conventions from chapter 4.
  • When the welcome line prints "Welcome to !", use var_dump() on the variable first to see why, before you fix it.
  • The output must match the expected output below exactly.
Stuck? A Few Hints
  • Fix one error at a time, starting with the first message PHP shows — later errors often disappear or change once an earlier one is fixed.
  • "unexpected token" on a line you didn't break? Read the line before it (chapter 2).
  • unexpected token "$" or unexpected integer points at a name PHP can't accept (chapter 4).
  • "Unterminated comment" means a /* was opened and never closed (chapter 3).
  • One rule about the very first statement in the file isn't checked until all the other syntax is fixed (chapter 6). And remember: variable names care about capital letters (chapter 3).

Ready to Build It?

Opens the Playground, right in your browser — nothing to install.

Open Playground

A correct run prints exactly four lines: Booking page for Tom's Barbershop · First slot: 9:00 · Welcome to Tom's Barbershop! · Second barber today: Ben — and nothing else, no warnings.

Before You Move On

If you found all five, you can now read a PHP file the way PHP does: where code starts and stops, where each statement ends, what's a comment, which names are valid, and what the strict-types line is for — and when something looks wrong, you look inside it with var_dump() instead of guessing. That's the foundation every later Act builds on. Next: variables, properly.