← 문제 목록
고급 PHP 100P

Readonly Property 함정

다음 PHP 8.1 코드에서 오류가 발생하는 위치는?
PHP
<?php
class Config {
    public function __construct(
        public readonly array $settings = []
    ) {}
}

$config = new Config(['debug' => true]);
$config->settings['cache'] = true;

답변

로그인 후 제출하기
0명 풀이 · 정답률 0%