Brent 10/9/2021

PHP 8.1: new in initializers

Read Original

This article details PHP 8.1's new feature allowing the `new` keyword in initializers, such as parameter default values and attribute arguments. It explains how this simplifies code by enabling object instantiation directly in constructor parameters and attributes, with examples and important behavioral notes.

PHP 8.1: new in initializers

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser