← codetypingtest

PHP typing test

PHP powers a large part of the web, and typing it is all about the dollar sign: every variable starts with $. Add -> for properties, . for joining strings and <?php at the top of the file, and you have one of the most distinctive languages in the test.

Start the PHP typing test

What you'll type in PHP

Example: FizzBuzz in PHP

Seven lines, and $i appears seven times: PHP is a dollar-sign drill.

<?php
for ($i = 1; $i <= 15; $i++) {
    if ($i % 15 == 0) echo "FizzBuzz\n";
    elseif ($i % 3 == 0) echo "Fizz\n";
    elseif ($i % 5 == 0) echo "Buzz\n";
    else echo $i . "\n";
}

Type this program now

Tips for typing PHP faster

All 20 PHP programs

Every program is real, working PHP. Choose one to start typing it straight away.

Beginner

Intermediate

Advanced

Expert

How the test works

The timer starts on your first key and stops once every character is right. Press Enter for a new line and the indentation is filled in for you. A wrong key shows in red and counts as a mistake; press Backspace to go back and fix it. Your best time for each program is saved in your browser. Read more about how speed and accuracy are calculated, or get tips for typing code faster.

Other languages