当你 $this->pri_A = 10; 后,将在对象 $b 中创建名为 pri_A 的公共属性(public)
这一点你可以这样看到
print_r($b);
输出:
B Object
(
[pub_B] =>
[pri_B:private] =>
[pub_A] =>
[pri_A:private] => It is private of A!
[pri_A] => 10
)
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn