Using Constructor Property Promotion
Learn how constructor property promotion significantly reduces the lines of code.
We'll cover the following...
Aside from the Just-In-Time (JIT) compiler, one of the greatest new features introduced in PHP 8 is constructor property promotion. This new feature combines property declarations and argument lists in the __construct()
method signature, as well as assigning defaults. In this section, we will learn how to substantially reduce the amount of coding required in property declarations as well ...