About scope and OOP in PHP
问题 I am having trouble understanding how to work with objects. The specific code: class first{ class second{ public function widgets(){ $a_variable = $a_value; } #1 } $second = new second; #2 } #3 $first = new first; If I initialize $a_variable as $a_variable it is only available inside the function, correct? If I initialize $a_varialbe as $this->a_variable it is only available inside class second, correct? Can I initialize $a_variable as $first->second->a_variable ? If so, How would I call it