PHP Typing Speed Test
Every PHP variable starts with `$` — a Shift-4 reach other languages reserve for rare cases, here required thousands of times a day. Add `->` for object access and `=>` for arrays, and PHP has one of the most distinctive symbol signatures in programming.
The Sigil Tax and Arrow Pairs
The dollar sigil is PHP's defining keystroke cost: `$user`, `$this`, `$total` — every variable read or write starts with Shift-4, so a fluent PHP typist must make that reach without any pause. Object member access uses `->` (`$this->total`), while associative arrays use `=>` (`'key' => $value`), meaning both arrow forms coexist and must stay distinct in muscle memory.
PHP 8 modernized the idiom: constructor property promotion stacks visibility keywords with typed parameters, `fn($u) => $u['active']` compresses closures, `match` expressions replace switch with arrow arms, and the nullsafe operator chains `?->`. Double colons appear for static access (`User::find`), and string concatenation uses the period — a subtle trap for typists coming from JavaScript's `+`.
Key Drills for PHP:
- Sigil without thought: Shift-4 before every variable is PHP's tax. Drill it until `$this->` is one uninterrupted motion.
- Two arrows, two meanings: `->` for objects, `=>` for arrays — practice both until context switches don't slow you down.
- Concatenate with a period: PHP joins strings with `.` not `+`. Retrain the reflex if you also write JavaScript.
Sample Drill: Array Map & Filter
Transforming arrays with array_map, array_filter, and arrows.
$active = array_filter($users, fn($u) => $u['active']);
$emails = array_map(fn($u) => strtolower($u['email']), $active);
foreach ($emails as $email) {
echo $email . PHP_EOL;
}
All 15 PHP Drills
Every session picks a random drill from this pool. Use the difficulty filter above to stay on easy warm-ups or jump straight to the hard ones.
-
Array Map & Filter easy
Transforming arrays with array_map, array_filter, and arrows.
-
PDO Prepared Statement easy
Query users safely with a named placeholder and fetch associative rows.
-
JSON Encode & Decode easy
Encode an array to JSON and decode a body with exceptions on errors.
-
Building a URL Slug easy
Lowercase, replace non-alphanumerics, and trim dashes to make a slug.
-
Array Destructuring & Spread easy
Unpack lists and keyed arrays and merge options with the spread operator.
-
Typed Class & Constructor medium
Constructor property promotion with typed properties.
-
Backed Enums medium
Declare a string-backed enum with a method that uses self comparison.
-
Eloquent Query Builder medium
Eager load relations and filter posts by tag with whereHas and paginate.
-
Multiple Catch Blocks medium
Handle declined cards and gateway failures separately, releasing a lock.
-
Generators for CSV Rows medium
Yield CSV rows lazily and always close the file handle.
-
Match Expression & Null Safety hard
Match expressions and the nullsafe operator chain.
-
Laravel Store Action hard
Validate a request, create a post for the user, and sync its tags.
-
Middleware Pipeline hard
Compose middleware closures into one handler with array_reduce.
-
Readonly Value Object hard
Model money with promoted readonly properties and a currency guard.
-
Tiny DI Container hard
Register lazy singleton factories and resolve them with ??= caching.
The Symbols That Slow You Down
The keystrokes below are where PHP typing speed is won or lost. Key positions shown for QWERTY — the pattern transfers to any layout, just on different physical keys.
| Symbol | Used For | Keys | How to Drill It |
|---|---|---|---|
| $ | Variable sigil | Shift+4 | Every variable starts here: `$user`, `$this`, `$total`. Shift-4 must cost literally nothing in PHP. |
| -> | Object access | - unshifted, then > as Shift+Period | `$this->total` — the hyphen-greater-than pair is PHP's most-typed two-key combo. |
| => | Array pair | = unshifted, then > as Shift+Period | `'key' => $value` — coexists with the object arrow, and both must stay distinct in your hands. |
| :: | Static access | Shift+Semicolon twice | `User::find`, `self::class` — doubled shifted colons for statics and constants. |
| <?php | Open tag | < as Shift+Comma, ? as Shift+Slash | Starts most files. Two shifted symbols to open — type the tag whole, not letter by letter. |
| . | Concatenation | Unshifted period | PHP joins strings with a period, not a plus — a deliberate retraining if you also write JavaScript. |
Common PHP Typing Mistakes
- ✗ Dropping the `$` sigil at typing speed — it's the single most common PHP typo and PHP's defining keystroke.
- ✗ Swapping `->` and `=>` — object access versus array pairs. Drill both in one session until the switch is clean.
- ✗ Using the plus sign to concatenate out of JavaScript habit — the period is PHP's joiner.
What's a Good PHP Typing Speed?
Sigil-heavy PHP types around 25–40 WPM in real code, with 45+ WPM at 96%+ accuracy being excellent. If `$this->` isn't one uninterrupted motion yet, that's the highest-value drill on this page.