haphpiness

These are things in PHP which make me genuinely_happy();

From Zero Types to Full Type Algebra in 10 Years

In 2015, PHP had no scalar type declarations. By 2025, it had union types, intersection types, DNF types, typed properties, typed constants, enums, readonly properties, property hooks, asymmetric visibility, never, and standalone true/false/null types. That's 17 distinct type system features in 10 years.

VersionYearType Feature
7.02015Scalar types, return types, strict mode
7.12016Nullable types (?Type), void, iterable
7.22017object type hint
7.42019Typed properties, covariant returns
8.02020Union types, mixed, static return
8.12021Intersection types, enums, readonly, never
8.22022DNF types, standalone true/false/null
8.32023Typed class constants, #[Override]
8.42024Property hooks, asymmetric visibility
8.52025Pipe operator, clone with, #[NoDiscard]

And the community backed this up with tooling. PHPStan — a static analyser that catches bugs without running your code — has over 300 million Packagist downloads. 52% of PHP developers use it, according to the JetBrains 2023 Developer Ecosystem survey.

300M+
PHPStan downloads
52%
PHP devs using PHPStan
17
Type features in 10 years

Source: php.net migration guides · Packagist · JetBrains Developer Ecosystem 2023

PHP didn't just add types — it built a complete type algebra, from basic scalar hints all the way to disjunctive normal form. And a whole static analysis ecosystem grew alongside it, catching bugs that unit tests miss.

Significance: Evolution at Speed

Most languages take decades to build a mature type system. PHP did it in ten years, in backward-compatible increments, without breaking existing code. Every step was voted on through the transparent RFC process, and every step was complemented by tooling. The result: PHP in 2025 has stricter type guarantees than many languages that were "typed from the start".