<分区>
Possible Duplicate:
Operator Overloading in PHP
有没有办法重载 = 运算符?
所以我想要的是:
class b{
function overloadis(){
// do somethng
}
}
$a = new b();
$a = 'c';
在上面的例子中,我想要 when $a = 'c';被调用时,首先调用方法 overloadis,然后该函数确定操作(将“c”分配给 $a)是执行还是中止。
这有可能吗?
提前致谢, 鲍勃