Created
November 29, 2020 19:20
-
-
Save iluuu1994/30b46a16412858d3a96f859a2d584a21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Sum { | |
public initonly int $sum; | |
public function __construct( | |
public initonly int $lhs, | |
public initonly int $rhs, | |
) { | |
$this->sum = $this->lhs + $this->rhs; | |
} | |
} | |
$sum = new Sum(1, 2) with { sum: 4 }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment