PHP spans two worlds: modern typed frameworks and fifteen-year-old legacy estates, and most real jobs involve both. These questions test modern-PHP fluency, security instincts, and the legacy judgment that PHP work disproportionately requires, with notes on what strong answers cover.
What a strong answer covers
Concrete adoption: constructor property promotion, enums, readonly properties, union types, named arguments, attributes, match expressions, fibers awareness. The framing matters β candidates should connect features to eliminated bug classes (type errors, boilerplate), not recite release notes.
What a strong answer covers
Share-nothing request lifecycle β code compiled then discarded per request β with OPcache keeping compiled bytecode in memory and preloading pinning framework code. Understanding this model explains PHP scaling behavior and why memory leaks matter less but cold starts matter more than in daemon runtimes.
What a strong answer covers
Prepared statements always, context-aware output escaping, framework CSRF tokens. The slip-through half is the test: raw queries in report code, echo of user data in admin panels, API endpoints excluded from CSRF middleware improperly. Security answered as habit plus audit, not just mechanism.
What a strong answer covers
declare(strict_types=1) semantics, parameter/return/property types, and a reasoned stance: strict at boundaries and domain code, with static analysis (PHPStan or Psalm at meaningful levels) doing the enforcement runtime types cannot. Static-analysis fluency is the modern professional marker.
What a strong answer covers
PSR-4 mapping namespaces to directories, the autoloader's role, semantic versioning and lockfile discipline, and when to extract internal packages. Private-package tooling (Satis, private Packagist, monorepo paths) appears in answers from people who have run larger PHP estates.
What a strong answer covers
Profiling first β Xdebug profiles, Blackfire, or APM β then the ladder: N+1 queries and missing indexes, over-eager ORM hydration, external API calls in-request, missing caches, OPcache misconfiguration. Ordered, measure-first methodology beats a list of generic optimizations.
What a strong answer covers
Queues with workers (framework queues, RabbitMQ/Redis-backed), cron-scheduled jobs, and supervisord-managed long-running consumers with memory-restart hygiene. Awareness of newer async runtimes β Swoole, RoadRunner, FrankenPHP β with honest scoping of when they pay is a currency signal.
What a strong answer covers
Stabilize and observe: version-control hygiene, staging environment, error tracking, characterization tests on money paths. Then incremental modernization: PHP version stepping with compatibility tooling (Rector), strangler-pattern extraction, no big-bang rewrite pitch. This question predicts success in half the PHP jobs that exist.
What a strong answer covers
Laravel for product velocity and ecosystem, Symfony for component architecture and long-horizon enterprise work, micro or no framework for tiny services. Judgment shown by matching to team and product rather than tribal loyalty; knowing Symfony components underpin much of the ecosystem is depth.
What a strong answer covers
PHPUnit or Pest, in-memory or containerized databases, mocking at architectural seams. Retrofit strategy: characterization tests capturing current behavior, breaking hidden dependencies (globals, statics, superglobals) via seams, testing around bugs before fixing. Legacy-testing literacy is rare and valuable in PHP hiring.
What a strong answer covers
Session lifecycle and storage backends (files versus Redis for multi-server), cookie flags β HttpOnly, Secure, SameSite β session fixation and regeneration on privilege change, and timeout policy. Finding session data trusted as authorization without re-checking is the classic audit story worth hearing.
What a strong answer covers
Local sessions break (move to shared store), local file uploads break (object storage), cron duplication (locks or a scheduler), cache coherence, and database as the eventual bottleneck with read replicas and query work. The breaks-first framing tests whether they have actually done it.
Skip the interviews entirely β get matched with pre-vetted PHP developers in 48 hours, $0 until you hire.
Need a custom question set?
Our free interview question generator builds a tailored list for any role, seniority, and focus area.
Try the interview question generator βFor a Laravel or Symfony codebase, the specialist ships weeks sooner β pair this set with our Laravel questions in that case. For legacy estates or mixed stacks, the modernization and testing questions here matter more than any framework badge.
Sometimes, but verify explicitly: WordPress development often bypasses Composer, namespacing, testing, and modern typing. The autoloading, static-analysis, and testing questions in this set will separate application engineers from theme-and-plugin backgrounds quickly.
A refactoring exercise over a deliberately messy 150-line legacy script: add tests, extract functions, fix the injection vulnerability planted inside. It mirrors real PHP work far better than greenfield coding and exercises the legacy judgment these questions probe.
Hire directly
Hire vetted PHP developers in the USA βOther interview guides
Vetted talent ready for US teams. No recruitment fees. Zero risk.
πΊπΈ Trusted by companies across the United States