変数のアクセスを public から別のクラスの保護に変更することは可能ですか? 私の意見では、これは私のわずかな知識では不可能ですが、PHP の専門家が私を助けてくれることを願っています。
class A
{
var $myvar;
}
Class B
{
function __Construct()
{
$A = new A();
// Can I change scope of $A->myvar to protected?
}
}