Technical Mid Level

Which PHP 8.x features have had the biggest impact on your code? Walk me through a specific refactoring that used them.

Quick Tip

Pick 2-3 features you actually use and show the improvement: "Constructor promotion cut our DTO boilerplate by 60%. Readonly properties eliminated an entire class of setter-related bugs."

What good answers include

Key PHP 8.x features: named arguments, match expression, constructor promotion, union/intersection types, readonly properties, enums, fibers, first-class callables. Strong candidates describe a real refactoring: reducing boilerplate with constructor promotion, replacing switch statements with match, using readonly properties for value objects, or using enums for state machines.

What interviewers are looking for

Tests whether candidates keep up with the language. Those still writing PHP 7.x style code are not leveraging modern tooling. Ask for a specific file or class they refactored.

← All PHP questions