typestar

Languages

PHP

A server-side language that runs a large share of the web, including WordPress and Wikipedia.

Practice PHP

27 steps across 1 tours, from the basics to complete programs.

The tours

First released
1995
Created by
Rasmus Lerdorf
Typing
Dynamic with optional declared types; strict_types makes them bite
Snippets target
8.5
File extensions
.php

What it is for

PHP serves a staggering share of the web: WordPress alone powers two fifths of all sites, and Wikipedia, Slack's backend origins, and countless internal tools run on it. It deploys like nothing else — copy a file to a server and it is live — which is exactly why a generation of programmers shipped their first dynamic page in it. Nobody's resume leads with PHP, and an enormous number of paychecks depend on it.

Modern PHP is a different language from its reputation. PHP 7 doubled performance, PHP 8 added a JIT, enums, match expressions, named arguments, constructor property promotion, and null-safe chaining. Composer gave it a dependency ecosystem as good as any, and frameworks like Laravel and Symfony are why the language still wins greenfield projects, not just legacy ones.

Its rough edges are honestly earned: a standard library with inconsistent naming (strlen but str_word_count), arrays that are lists, maps, and neither, and a type juggling history that strict_types exists to apologize for. Knowing where the sharp edges are — and writing the typed, modern dialect that avoids them — is what separates current PHP from the copy-pasted kind.

Where it came from

Rasmus Lerdorf wrote Personal Home Page tools in 1994 to track visits to his resume, and released PHP/FI publicly in 1995. He has always been frank that it grew rather than being designed — the language's early inconsistencies date from an era when it was a template layer, not a language.

PHP 3 (1998) rewrote the core and coined the recursive name PHP: Hypertext Preprocessor; PHP 4's Zend Engine (2000) made it fast enough for real applications, and PHP 5 (2004) brought a real object model. The abandoned PHP 6 left a scar — Unicode plans collapsed — so the next release was 7.

PHP 7 (2015) doubled real-world performance and made types declarable; PHP 8 (2020) added the JIT, attributes, enums, and match. The yearly release cadence since then has steadily deprecated the legacy footguns, which is why 'modern PHP' names a genuinely different dialect than the 2005 tutorials that fixed its reputation.

What it is like to type

PHP types with punctuation other languages save for special occasions: a dollar sign opens every variable, methods arrive through ->, static members through ::, and string interpolation swallows both. The double arrow => builds every associative array. Your right hand lives on the sigil row, which is exactly the muscle memory the seeds train — expect lower first runs than in cleaner-looking languages, and quick gains.

Practice PHP

27 steps across 1 tours, from the basics to complete programs.

Official documentation

Other languages