なぜこれが機能するのですか?つまり、プライベート変数にアクセスします。
クラステスト{ プライベート$q= 0; パブリック関数__construct(){ $ this-> q = 1; } public static function EpicConstruct(){ $ test = new self(); $ test-> q = 2; $testを返します。 } } $ test = Test :: EpicConstruct();
なぜこれが機能するのですか?つまり、プライベート変数にアクセスします。
クラステスト{ プライベート$q= 0; パブリック関数__construct(){ $ this-> q = 1; } public static function EpicConstruct(){ $ test = new self(); $ test-> q = 2; $testを返します。 } } $ test = Test :: EpicConstruct();