php overload = operator [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Operator Overloading in PHP Is there a way to overload the = operator ? So want I is the following: class b{ function overloadis(){ // do somethng } } $a = new b(); $a = 'c'; In the example above, I want that when $a = 'c'; is called, the method overloadis is called first and then that function desides if the action (assign 'c' to $a) is executed or aborted. Is it possible to do this ? Thnx in advance, Bob 回答1: