What is PHP 7 and what major features did it introduce?
Why Interviewers Ask This
Foundational questions like this help interviewers calibrate the rest of the interview. A confident, accurate answer signals that you have solid PHP basics — a prerequisite for any developer role.
Answer
PHP 7 (released December 2015) was a landmark release that doubled performance over PHP 5 through a new Zend Engine 3 with the PHPNG (PHP Next Generation) optimizations. Key new features: scalar type declarations (int, float, string, bool for parameters and returns), return type declarations, null coalescing operator (??), spaceship operator (<=>), anonymous classes, group use declarations, integer division function (intdiv()), uniform variable syntax, and throwable interface (allowing both Errors and Exceptions to be caught with a single catch). It also removed deprecated features like the mysql_* extension. PHP 7 made PHP a genuinely competitive language for high-performance applications.
Pro Tip
If you're unsure about a detail, say so honestly and explain your reasoning. Interviewers respect candidates who can think through uncertainty rather than bluffing.
Previous
What are PHP closures (anonymous functions)?
Next
What is PHP 8 and what major features did it introduce?