类似于异步执行的意思吧,如下,能否在不改变各个函数调用顺序的情况下通过改写函数实现one()
three()
也能输出something
?
function one(){
echo $GLOBALS['obj'];
}
function two(){
$GLOBALS['obj'] = 'something';
}
function three(){
echo $GLOBALS['obj'];
}
// Undefined index
one();
two();
// Undefined index
three();
如果不能,是否有相关的解决方案?
认证0级讲师