Source: www.amitmerchant.com

Constructor Property Promotion in PHP 8

Category: PHP, javascript

A blog on PHP, JavaScript and more Amit Merchant · June 9, 2020 · ⋆ PHP Wouldn’t it be nice if you don’t have to declare the class property over and over again just to use it across the class?

According to this RFC (which is accepted), Constructor Property Promotion is coming in PHP 8. With the use of constructor property promotion, it will be really easy to declare class properties by just declaring and defining properties all in one place.

Follow me on Twitter @amit_merchant Constructor Property Promotion in PHP 8 Try not to use ad blockers, please!
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners