У меня бредает мозг, и я подозреваю, что это действительно просто.
Рассмотрим этот код с двумя классами:
<?php
class myparentclass {
protected $vara;
private $varb;
public $varc;
public $_childclass;
function __construct() {
$this->vara = "foo";
$this->varb = "bar";
$this->varc = ":(";
$this->_childclass = new mychildclass;
}
}
class mychildclass extends myparentclass {
function __construct() {
print_r ($this);
}
}
print "<pre>";
$foo = new myparentclass();
Вывод:
mychildclass Object
(
[vara:protected] =>
[varb:private] =>
[varc] =>
[_childclass] =>
)
Я знаю, что $ varb не следует устанавливать, но как насчет остальных?