# PHP 8: Constructor property promotion

DevFeed: [PHP 8: Constructor property promotion](<https://devfeed.tech/articles/php-8-constructor-property-promotion-44107.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/constructor-promotion-in-php-8>)

Author: Brent

Published: 2020-06-12T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [constructor](<https://devfeed.tech/topics/constructor.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Boilerplate](<https://devfeed.tech/topics/boilerplate.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [boilerplate](<https://devfeed.tech/tags/boilerplate.md>), [code](<https://devfeed.tech/tags/code.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [php](<https://devfeed.tech/tags/php.md>), [programming](<https://devfeed.tech/tags/programming.md>), [property](<https://devfeed.tech/tags/property.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

## AI overview

This tutorial explains PHP 8 constructor property promotion, a syntax that combines class fields, constructor definitions, and variable assignments to reduce boilerplate when creating simple objects such as value objects and data transfer objects. It also discusses constraints and usage details, including constructor-only use, duplicate property names, typing, default values, mixing promoted and normal properties, and access from the constructor body.

## Source excerpt

Read the full post on https://stitcher.io/blog/constructor-promotion-in-php-8