동적 속성을 허용하지 않는 PHP 클래스는 어떻게 만듭니 까? 구조에PHP의 값 객체
class User
{
public $username;
public $password;
}
$user = new User;
$user->username = "bill.gates";
// This is a dynamic property and I need setting it to be considered illegal.
$user->something = 123;
이 또한 것이다 개발자가 유효하고 동적이지 않은 속성에 값을 할당하는 것을 금지합니다. 맞습니까? – umlcat