📌  相关文章
📜  如何在 php 代码示例中访问私有成员和受保护成员

📅  最后修改于: 2022-03-11 14:54:16.237000             🧑  作者: Mango

代码示例1
name;
    }

}

$daddy = new Daddy;
echo $daddy->displayGrandPaName(); // Prints 'Mark Henry'

$outsiderWantstoKnowGrandpasName = new GrandPa;
echo $outsiderWantstoKnowGrandpasName->name; // Results in a Fatal Error