hooks の setter に渡される class Example { public function __construct( public private(set) string $firstName { set => ucfirst($value); }, public private(set) string $lastName { set => ucfirst($value); }, ) { } } $ex = new Example('charlie', 'brown'); echo $ex->firstName . PHP_EOL; # 出力例: Charlie echo $ex->lastName . PHP_EOL; # 出力例: Brown 10 / 16