PHP
A server-side scripting language purpose-built for the web.
PHP was designed for web development from the start and still powers a very large share of the web, largely via WordPress and frameworks like Laravel. Modern PHP (8.x) is a substantially different language from the PHP of a decade ago — it has real type declarations, JIT compilation, enums, and a mature package ecosystem via Composer.
When to use it
- You're building on WordPress or another PHP-based CMS
- You want Laravel's productivity — PHP's most complete, batteries-included web framework
- Your hosting environment is optimized for PHP (shared hosting, many managed platforms) and that constraint matters
- Your team already has strong PHP experience and switching languages isn't worth the cost
Considerations
- Perception often lags reality — modern PHP 8.x is a much stronger language than PHP's older reputation suggests, but that reputation still affects hiring conversations
- Request-per-process execution model (shared-nothing) differs from Node/Python's long-running-process model, which affects how in-memory caching and connection pooling work
- Package quality varies more than in some other ecosystems — Composer package vetting matters
Key concepts
Composer
PHP's dependency manager and autoloader — the equivalent of npm/pip for PHP.
Shared-nothing execution
Each request typically starts with a fresh process/interpreter state — no shared in-memory state between requests by default.
PSR standards
PHP Standard Recommendations define interoperability conventions (autoloading, HTTP messages, logging) that most modern frameworks follow.
Type declarations
PHP 8.x supports strict types, union types, and readonly properties — much closer to a statically-typed language than older PHP.
Getting started
composer initCreate a new composer.json for a PHP project.
composer require <package>Add and install a dependency.
Common mistakes
- Judging modern PHP (8.x) by its old reputation — strict types, enums, and JIT compilation make it a meaningfully different language than a decade ago.
- Assuming in-memory state persists between requests the way it does in a long-running Node/Python process — PHP's shared-nothing model starts fresh each request, so caching needs explicit handling (e.g. Redis), not just an in-process variable.
- Installing Composer packages without checking their maintenance status — package quality varies more in the PHP ecosystem than in some others, so vetting matters.
Ecosystem
Related tools
This guide states trade-offs, not a single "best" answer — the right choice depends on your team, constraints, and existing stack.
