PHP Interview Questions
PHP interview questions
PHP interview questions for back-end developers: modern PHP 8, Laravel or Symfony, security, databases and testing.
Short answer: Strong PHP candidates write modern PHP 8 with types, use Composer and a framework such as Laravel or Symfony, and know security basics. Seniors should cover architecture, performance with OPcache and queues, testing with PHPUnit and safe database access.
How to Use These Questions
Pick 6 to 8 questions that match the role level. Ask follow-ups on real trade-offs, not definitions. Score each answer from 1 to 4 against the “strong answer” column.
PHP Interview Questions by Level
Junior
| Question | What a strong answer covers |
|---|---|
| What changed in PHP 8? | Union types, named arguments, match, nullsafe operator, JIT. |
| How do you prevent SQL injection? | Prepared statements with PDO or the framework ORM, never string building. |
| What is Composer? | Dependency manager, autoloading with PSR-4, lock files. |
Mid-level
| Question | What a strong answer covers |
|---|---|
| Explain the request lifecycle in Laravel or Symfony. | Front controller, routing, middleware, controller, response. |
| How do you handle authentication? | Framework guards, password hashing, sessions vs tokens. |
| How do you write tests in PHP? | PHPUnit or Pest, feature vs unit tests, factories. |
Senior
| Question | What a strong answer covers |
|---|---|
| How do you make a PHP app faster? | OPcache, caching, queues, query optimisation, profiling. |
| How would you split a legacy PHP monolith? | Strangler pattern, clear modules, tests first, gradual refactoring. |
| How do you deploy PHP safely? | CI/CD, zero-downtime deploys, migrations and rollbacks. |
A Practical PHP Task
Ask the candidate to build a small REST endpoint in Laravel or Symfony with validation, a database table and two tests. Review structure, validation and security.
Red Flags in a PHP Interview
- Builds SQL from user input
- Stores passwords with md5
- No Composer or autoloading
- No tests
- Cannot explain the framework request flow
Interview Scorecard
| Area | 1 β weak | 4 β strong |
|---|---|---|
| Modern PHP | PHP 5 habits | Typed PHP 8 code |
| Framework use | Fights the framework | Uses framework conventions well |
| Security | Unsafe queries and hashing | Prepared queries, proper hashing |
| Testing | None | Feature and unit tests |
Hire Vetted PHP Talent Without Running Every Interview
Staffenza runs five vetting steps for you: CV and portfolio review, technical assessment, live technical interview, English check and references. Remote engineers from India or Pakistan cost USD 225 a month on top of salary. In the UAE and Saudi Arabia, direct hire costs 15β20% of the first-year package, with a 3-month replacement guarantee.
The Bottom Line
Check modern PHP, framework knowledge and security first. Seniors should show performance tuning and safe refactoring of legacy code.
Related: hire PHP developers, SQL interview questions, JavaScript interview questions, all interview question guides.
Ready to hire? Email [email protected] or use our contact page.
PHP Interview FAQs
Laravel or Symfony?
Both are solid. Test in the framework your team uses.
Is PHP still used for new projects?
Yes. Laravel and WordPress keep PHP widely used.
What PHP version should candidates know?
PHP 8.x, since older versions are out of support.
How long should a PHP task take?
About 60 to 90 minutes.


















