속성 유형 힌트를 소개할 때 갑자기 “초기화 전에 Typed properties must accessed before initialization” 오류가 나타나는 이유는 무엇입니까?
새로 도입된 속성 유형 힌트를 활용하기 위해 클래스 정의를 다음과 같이 업데이트했습니다. class Foo { private int $id; private ?string $val; private DateTimeInterface $createdAt; private ?DateTimeInterface $updatedAt; public function __construct(int $id) { $this->id = $id; } public function getId(): int { return $this->id; } public function getVal(): ?string { return $this->val; } public function getCreatedAt(): … Read more