My PHP Problems
PHP’s mix of extreme productivity and long-standing design quirks continues to polarize web developers. Commenters highlight how easy it is to go from zero to a working backend and praise modern frameworks like Laravel and Symfony, while criticizing legacy inconsistencies, unsafe standard library behavior, and the tendency to blur presentation and business logic. Many note that despite cleaner alternatives and newer languages, PHP’s tight coupling to HTTP, ubiquity in hosting, and massive installed base keep it central to the web, even as its ecosystem evolves to hide or mitigate its rough edges.
PHP as a Highly Productive Web DSL
- Many describe PHP as extremely fast to get from idea to working web backend, even for newcomers or returners.
- Strengths: tight fit to HTTP, simple deployment (“drop a file on a server”), easy SSR, good hosting support, and strong ecosystem (WordPress, Laravel, Symfony).
- Some compare PHP to Go as a “DSL for networked/web services” and note PHP’s request-per-process model and built-in handling of GET/POST/cookies as unique advantages.
Mixing PHP and HTML vs. Templating Systems
- Debate over whether PHP-as-template is a feature or a historic mistake.
- Pro side: no extra templating language, simple loops/conditionals, fast to build and debug, PHP “is” the templating engine.
- Con side: encourages 1000‑line mixed PHP/HTML/SQL files, poor separation of concerns, and makes it easy for juniors to put DB logic in views.
- Some argue frameworks and template engines exist mainly to enforce conventions and guard rails.
- Comparisons with JSX: some see it as “PHP-style mixing rebranded,” others stress JSX is just syntax over function calls with better XSS safety.
Language Design Quirks and Evolution
- Frequent complaints about inconsistent stdlib APIs (e.g., argument order), functions returning
falseinstead of throwing, weak iterator support, and awkward use of PHP as a “real” templating system (globals, include semantics). - Others argue many of these issues are mitigated by tools/libraries (safe wrappers, Psalm/PHPStan, functional helpers) and recent core improvements (e.g., new JSON helpers).
- Wishes for better async/await support, proper binary data/buffer primitives, and richer container types beyond arrays.
- Some feel newer features and “fancy” patterns add cognitive load when overused.
Frameworks, Ecosystem, and Tooling
- Laravel praised for rapid prototyping; Symfony for structured, “enterprise” apps (though some find it too “magical” or under‑documented).
- GraphQL: strong enthusiasm for Laravel Lighthouse’s schema‑first approach and deep ORM integration; mixed experiences with other PHP GraphQL stacks.
- Mentions of modern tooling like Swoole/FrankenPHP (performance, server model), static analyzers, and safe wrappers show PHP can support robust, modern workflows.
Legacy, Perception, and Career Reality
- Large part of PHP’s bad reputation comes from legacy WordPress/CF/old‑PHP5 codebases and rushed agency work.
- Several note that modern greenfield PHP (with frameworks and tooling) can be pleasant, performant, and lucrative, but many jobs still involve “rescuing” old code.