在函数中调用现有的全局是否有记忆效应?
即
$someclass = new SomeClass();
$someclass->otherclass = new OtherClass();
function foo() {
global $someclass;
$someclass->otherclass->do_stuff();
}
VS
$someclass = new SomeClass();
$someclass->otherclass = new OtherClass();
function foo() {
$otherclass = new OtherClass();
$otherclass->do_stuff();
}