Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php 8 constructor property promotion

class CustomerDTO
{
    public function __construct(
        public string $name, 
        public string $email, 
        public DateTimeImmutable $birth_date,
    ) {}
}
Source by stitcher.io #
 
PREVIOUS NEXT
Tagged: #php #constructor #property #promotion
ADD COMMENT
Topic
Name
9+9 =